Cap the auto-scheduled builds to 10
This commit is contained in:
parent
b2655cac5b
commit
a0575eeac5
|
@ -91,7 +91,7 @@ impl<E: stats::SysEvents> worker::SimpleWorker for MassRebuildWorker<E> {
|
||||||
let gists = self.github.gists();
|
let gists = self.github.gists();
|
||||||
let issue = repo.issue(job.pr.number);
|
let issue = repo.issue(job.pr.number);
|
||||||
|
|
||||||
let auto_schedule_build_archs: Option<Vec<buildjob::ExchangeQueue>>;
|
let auto_schedule_build_archs: Vec<buildjob::ExchangeQueue>;
|
||||||
|
|
||||||
match issue.get() {
|
match issue.get() {
|
||||||
Ok(iss) => {
|
Ok(iss) => {
|
||||||
|
@ -101,10 +101,10 @@ impl<E: stats::SysEvents> worker::SimpleWorker for MassRebuildWorker<E> {
|
||||||
return self.actions().skip(&job);
|
return self.actions().skip(&job);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto_schedule_build_archs = Some(self.acl.build_job_destinations_for_user_repo(
|
auto_schedule_build_archs = self.acl.build_job_destinations_for_user_repo(
|
||||||
&iss.user.login,
|
&iss.user.login,
|
||||||
&job.repo.full_name,
|
&job.repo.full_name,
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
self.events.tick("issue-fetch-failed");
|
self.events.tick("issue-fetch-failed");
|
||||||
|
@ -390,6 +390,11 @@ impl<E: stats::SysEvents> worker::SimpleWorker for MassRebuildWorker<E> {
|
||||||
try_build.sort();
|
try_build.sort();
|
||||||
try_build.dedup();
|
try_build.dedup();
|
||||||
|
|
||||||
|
if try_build.len() <= 10 {
|
||||||
|
// In the case of trying to merge master in to
|
||||||
|
// a stable branch, we don't want to do this.
|
||||||
|
// Therefore, only schedule builds if there
|
||||||
|
// less than or exactly 10
|
||||||
let msg = buildjob::BuildJob::new(
|
let msg = buildjob::BuildJob::new(
|
||||||
job.repo.clone(),
|
job.repo.clone(),
|
||||||
job.pr.clone(),
|
job.pr.clone(),
|
||||||
|
@ -398,10 +403,11 @@ impl<E: stats::SysEvents> worker::SimpleWorker for MassRebuildWorker<E> {
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
for (dest, rk) in auto_schedule_build_archs.unwrap_or(vec![]) {
|
for (dest, rk) in auto_schedule_build_archs {
|
||||||
response.push(worker::publish_serde_action(dest, rk, &msg));
|
response.push(worker::publish_serde_action(dest, rk, &msg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Err(mut out) => {
|
Err(mut out) => {
|
||||||
eval_results = false;
|
eval_results = false;
|
||||||
state = hubcaps::statuses::State::Failure;
|
state = hubcaps::statuses::State::Failure;
|
||||||
|
|
Loading…
Reference in a new issue