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