Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BBesrour committed Dec 3, 2024
1 parent 5ae3f8e commit 778cdfc
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,13 @@ public ZonedDateTime getBuildJobEstimatedStartDate(long participationId) {
return ZonedDateTime.now();
}

// Get the jobs queued before the job for the participation
List<BuildJobQueueItem> jobsQueuedBefore = getQueuedJobs().stream().sorted(new LocalCIPriorityQueueComparator()).takeWhile(job -> !job.id().equals(buildJobId)).toList();

ZonedDateTime now = ZonedDateTime.now();

List<Long> agentsAvailabilities = new ArrayList<>(getQueuedJobs().stream().map(job -> getBuildJobRemainingDuration(job, now)).sorted().toList());
// Get the remaining duration of the build jobs currently being processed
List<Long> agentsAvailabilities = new ArrayList<>(getProcessingJobs().stream().map(job -> getBuildJobRemainingDuration(job, now)).sorted().toList());

if (agentsAvailabilities.size() < this.buildAgentsCapacity) {
int agentsToAdd = this.buildAgentsCapacity - agentsAvailabilities.size();
Expand Down

0 comments on commit 778cdfc

Please sign in to comment.