feat(server): update job queue when adding, removing or updating targets

This commit is contained in:
Jef Roosens 2022-12-13 13:58:51 +01:00
parent e742d3de6d
commit 6342789921
Signed by untrusted user: Jef Roosens
GPG key ID: B75D4F293C7052DB
2 changed files with 26 additions and 10 deletions

View file

@ -49,6 +49,13 @@ pub fn new_job_queue(default_schedule CronExpression, default_base_image string)
}
}
// insert_all executes insert for each architecture of the given Target.
pub fn (mut q BuildJobQueue) insert_all(target Target) ! {
for arch in target.arch {
q.insert(target, arch.value)!
}
}
// insert a new target's job into the queue for the given architecture. This
// job will then be endlessly rescheduled after being pop'ed, unless removed
// explicitely.