Run will start the scheduler.
(ctx context.Context, wg *sync.WaitGroup)
| 153 | |
| 154 | // Run will start the scheduler. |
| 155 | func (s *Scheduler) Run(ctx context.Context, wg *sync.WaitGroup) { |
| 156 | defer wg.Done() |
| 157 | |
| 158 | go s.runTaskCompletionListener(ctx) |
| 159 | |
| 160 | // Start rollout creator component |
| 161 | rolloutCreator := NewRolloutCreator(s.store, s.bus, s.webhookManager) |
| 162 | wg.Add(3) |
| 163 | go rolloutCreator.Run(ctx, wg, s.bus.RolloutCreationChan) |
| 164 | go s.runPendingTaskRunsScheduler(ctx, wg) |
| 165 | go s.runRunningTaskRunsScheduler(ctx, wg) |
| 166 | |
| 167 | slog.Debug("Task scheduler V2 started with independent runners") |
| 168 | <-ctx.Done() |
| 169 | } |
| 170 | |
| 171 | func (s *Scheduler) runTaskCompletionListener(ctx context.Context) { |
| 172 | defer func() { |