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

Method Start

coderd/x/gitsync/worker.go:131–145  ·  view source on GitHub ↗

Start launches the background loop. It blocks until ctx is cancelled, then closes w.done.

(ctx context.Context)

Source from the content-addressed store, hash-verified

129// Start launches the background loop. It blocks until ctx is
130// cancelled, then closes w.done.
131func (w *Worker) Start(ctx context.Context) {
132 defer close(w.done)
133
134 ticker := w.clock.NewTicker(w.interval, "gitsync", "worker")
135 defer ticker.Stop()
136
137 for {
138 select {
139 case <-ctx.Done():
140 return
141 case <-ticker.C:
142 w.tick(ctx)
143 }
144 }
145}
146
147// Done returns a channel that is closed when the worker exits.
148func (w *Worker) Done() <-chan struct{} {

Callers 1

Calls 3

tickMethod · 0.95
StopMethod · 0.65
DoneMethod · 0.45

Tested by 1