From: Michael Tremer Date: Thu, 6 Feb 2025 16:27:59 +0000 (+0000) Subject: jobs: Commit to the database as soon as we have dispatched it X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=469cb79fef0e956cc263fea65a0e78b8552ca888;p=pbs.git jobs: Commit to the database as soon as we have dispatched it Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/jobs.py b/src/buildservice/jobs.py index eb64a4f4..50f8ed41 100644 --- a/src/buildservice/jobs.py +++ b/src/buildservice/jobs.py @@ -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,