Run starts the rollout creator listening to the channel.
(ctx context.Context, wg *sync.WaitGroup, rolloutCreationChan chan bus.PlanRef)
| 33 | |
| 34 | // Run starts the rollout creator listening to the channel. |
| 35 | func (rc *RolloutCreator) Run(ctx context.Context, wg *sync.WaitGroup, rolloutCreationChan chan bus.PlanRef) { |
| 36 | defer wg.Done() |
| 37 | slog.Debug("Rollout creator started") |
| 38 | |
| 39 | for { |
| 40 | select { |
| 41 | case ref := <-rolloutCreationChan: |
| 42 | rc.tryCreateRollout(ctx, ref) |
| 43 | case <-ctx.Done(): |
| 44 | slog.Debug("Rollout creator stopped") |
| 45 | return |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | // tryCreateRollout attempts to create a rollout for the given plan. |
| 51 | func (rc *RolloutCreator) tryCreateRollout(ctx context.Context, ref bus.PlanRef) { |
no test coverage detected