Skip to content

Scheduler._addCommit fetches 100 tasks for each target, sequentially #167238

Open
@matanlurey

Description

@matanlurey
for (var target in targets) {
  final task = tasks.singleWhere((task) => task.taskName == target.name);
  var policy = target.schedulerPolicy;

  // ... omitted for brevity ...

  final priority = await policy.triggerPriority(
    taskName: task.name!,
    commitSha: commit.sha,
    recentTasks: await firestoreService.queryRecentTasksByName(
      name: task.name!,
    ),
  );
  if (priority != null) {
    // Mark task as in progress to ensure it isn't scheduled over
    task.setStatus(ds.Task.statusInProgress);
    toBeScheduled.add(
      PendingTask(target: target, task: task, priority: priority),
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.infra: cocoonRelated to the dashboard or cocoon serverteam-infraOwned by Infrastructure teamtriaged-infraTriaged by Infrastructure team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions