jobqueue: Replace JobArgs() with Job()

JobArgs() function replaced with more general Job() function that
returns all the parameters used to originally define a job during
Enqueue(). This new function enables access to the type of a job in the
queue, which wasn't available until now (except when Dequeueing).
This commit is contained in:
Achilleas Koutsou 2021-01-12 13:49:01 +01:00 committed by Ondřej Budai
parent 75a96bd99d
commit 668fb003ef
6 changed files with 26 additions and 18 deletions

View file

@ -405,7 +405,7 @@ func (h *apiHandlers) GetComposeIdManifests(ctx echo.Context, idstr string) erro
manifests := make([]distro.Manifest, len(deps)-1)
for i, id := range deps[1:] {
var buildJob worker.OSBuildKojiJob
if _, err := h.server.workers.JobArgs(id, &buildJob); err != nil {
if _, _, _, err := h.server.workers.Job(id, &buildJob); err != nil {
// This is a programming error.
panic(err)
}