]> git.ipfire.org Git - pbs.git/commitdiff
queue: Pass builder to fetch a new job
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 18 Jun 2022 12:12:20 +0000 (12:12 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 18 Jun 2022 12:12:20 +0000 (12:12 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/jobqueue.py
src/hub/queue.py

index a46d377180537eac4397a753973ccdcddc8da6e2..a3174490c12e1fae0879c3d22d878c4a3b424cf1 100644 (file)
@@ -22,7 +22,7 @@ class JobQueue(base.Object):
 
                return res.len
 
-       def pop(self, arches):
+       def pop(self, builder):
                """
                        Returns the next build job that matches the given architectures
                """
@@ -36,7 +36,7 @@ class JobQueue(base.Object):
                        WHERE
                                queue.arch = ANY(%s)
                        LIMIT 1""",
-                       arches,
+                       builder.supported_arches,
                )
 
        def get_length_for_arch(self, arch):
index 92aca941b7b48fec9c5efda52274a73bd949a1a5..c9df566f86b093e161b84c8e180336007531d23a 100644 (file)
@@ -58,7 +58,7 @@ def dispatch_jobs(backend):
                                continue
 
                        # We are ready for a new job
-                       job = backend.jobqueue.pop(builder.supported_arches)
+                       job = backend.jobqueue.pop(builder)
                        if not job:
                                log.debug("  No jobs waiting")
                                continue