( ctx context.Context, runs []taskpkg.Run, )
| 348 | } |
| 349 | |
| 350 | func (s schedulerTaskSource) joinRunsWithTasks( |
| 351 | ctx context.Context, |
| 352 | runs []taskpkg.Run, |
| 353 | ) ([]schedulerpkg.RunSnapshot, error) { |
| 354 | work := make([]schedulerpkg.RunSnapshot, 0, len(runs)) |
| 355 | for _, run := range runs { |
| 356 | taskRecord, err := s.store.GetTask(ctx, run.TaskID) |
| 357 | if err != nil { |
| 358 | return nil, fmt.Errorf("daemon: scheduler load task %q for run %q: %w", run.TaskID, run.ID, err) |
| 359 | } |
| 360 | if taskRecord.Paused { |
| 361 | continue |
| 362 | } |
| 363 | if pauseReader, ok := s.store.(interface { |
| 364 | IsTaskEffectivelyPaused(context.Context, string) (bool, string, error) |
| 365 | }); ok { |
| 366 | paused, _, err := pauseReader.IsTaskEffectivelyPaused(ctx, taskRecord.ID) |
| 367 | if err != nil { |
| 368 | return nil, err |
| 369 | } |
| 370 | if paused { |
| 371 | continue |
| 372 | } |
| 373 | } |
| 374 | work = append(work, schedulerpkg.RunSnapshot{Task: taskRecord, Run: run}) |
| 375 | } |
| 376 | return work, nil |
| 377 | } |
| 378 | |
| 379 | func (s schedulerTaskSource) filterPausedRuns( |
| 380 | ctx context.Context, |
no test coverage detected