]> git.ipfire.org Git - pbs.git/commitdiff
jobs: Commit to the database as soon as we have dispatched it
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 6 Feb 2025 16:27:59 +0000 (16:27 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 6 Feb 2025 16:27:59 +0000 (16:27 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/jobs.py

index eb64a4f4b23b612ccadddb6c0b51c44b86bf9559..50f8ed41c06d309ba0f3eb1bd0b86b814682dce8 100644 (file)
@@ -375,7 +375,12 @@ class Queue(base.Object):
                                                        # If we have a job, we dispatch it to the builder
                                                        await job.dispatch(builder)
 
-                                                       # Once we dispatched a job, we are done
+                                                       # Once we dispatched a job, we will commit the database
+                                                       # session so that the data is accessible if the builder
+                                                       # connects really quick and in case something goes wrong
+                                                       # dispatching any later jobs
+                                                       await self.db.commit()
+
                                                        break
 
                                                # If not suitable jobs could be found for this builder,