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

Method Close

enterprise/coderd/usage/cron.go:116–122  ·  view source on GitHub ↗

Close cancels all jobs and waits for goroutines to exit.

()

Source from the content-addressed store, hash-verified

114
115// Close cancels all jobs and waits for goroutines to exit.
116func (c *Cron) Close() error {
117 if c.cancel != nil {
118 c.cancel()
119 }
120 c.wg.Wait()
121 return nil
122}
123
124func (c *Cron) run(ctx context.Context, job CronJob) {
125 //nolint:gocritic // We are a publisher in this function

Callers 1

TestCronFunction · 0.95

Calls 2

WaitMethod · 0.65
cancelMethod · 0.45

Tested by 1

TestCronFunction · 0.76