MCPcopy Index your code
hub / github.com/coder/coder / Close

Method Close

agent/filefinder/engine.go:219–233  ·  view source on GitHub ↗

Close shuts down the engine.

()

Source from the content-addressed store, hash-verified

217
218// Close shuts down the engine.
219func (e *Engine) Close() error {
220 if e.closed.Swap(true) {
221 return nil
222 }
223 close(e.closeCh)
224 e.mu.Lock()
225 for _, rs := range e.roots {
226 rs.cancel()
227 _ = rs.watcher.Close()
228 }
229 e.roots = make(map[string]*rootState)
230 e.mu.Unlock()
231 e.wg.Wait()
232 return nil
233}
234
235// Rebuild forces a complete re-walk and re-index of a root.
236func (e *Engine) Rebuild(ctx context.Context, root string) error {

Callers 3

newTestEngineFunction · 0.95
TestEngine_CloseIsCleanFunction · 0.95

Calls 6

CloseMethod · 0.65
WaitMethod · 0.65
SwapMethod · 0.45
LockMethod · 0.45
cancelMethod · 0.45
UnlockMethod · 0.45

Tested by 3

newTestEngineFunction · 0.76
TestEngine_CloseIsCleanFunction · 0.76