MCPcopy Create free account
hub / github.com/bytebase/bytebase / Run

Method Run

backend/runner/taskrun/scheduler.go:155–169  ·  view source on GitHub ↗

Run will start the scheduler.

(ctx context.Context, wg *sync.WaitGroup)

Source from the content-addressed store, hash-verified

153
154// Run will start the scheduler.
155func (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
171func (s *Scheduler) runTaskCompletionListener(ctx context.Context) {
172 defer func() {

Callers 2

TestCheckTaskDriftFunction · 0.45
TestGetPrependStatementsFunction · 0.45

Calls 6

RunMethod · 0.95
NewRolloutCreatorFunction · 0.85
DebugMethod · 0.80

Tested by 2

TestCheckTaskDriftFunction · 0.36
TestGetPrependStatementsFunction · 0.36