From: Michael Tremer Date: Thu, 25 May 2023 09:49:17 +0000 (+0000) Subject: jobs: Show status as "queued" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d85b73e8009e393bc72b0f3ff3026a6b9ef1ee6;p=pbs.git jobs: Show status as "queued" Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/jobs.py b/src/buildservice/jobs.py index 38c78fc5..f25efebd 100644 --- a/src/buildservice/jobs.py +++ b/src/buildservice/jobs.py @@ -525,7 +525,7 @@ class Job(base.DataObject): # Propagate any changes to the build return await self.build._job_finished(job=self) - def is_pending(self): + def is_pending(self, installcheck=None): if self.has_finished(): return False @@ -535,8 +535,23 @@ class Job(base.DataObject): if self.is_running(): return False + # Did the caller ask for the installcheck to be successful? + if installcheck is True and not self.installcheck_succeeded: + return False + + # Did the caller ask for the installcheck to have failed? + elif installcheck is False and self.installcheck_succeeded: + return False + + # Otherwise just return True return True + def is_queued(self): + """ + The installcheck has been successful and the job is waiting to be dispatched + """ + return self.is_pending(installcheck=True) + def is_running(self): """ Returns True if this job is running diff --git a/src/templates/jobs/modules/list.html b/src/templates/jobs/modules/list.html index 92bf6010..d78f37a2 100644 --- a/src/templates/jobs/modules/list.html +++ b/src/templates/jobs/modules/list.html @@ -3,7 +3,9 @@
- {% if job.is_pending() and job.installcheck_succeeded is False %} + {% if job.is_queued() %} + {{ _("Queued") }} + {% elif job.is_pending(installcheck=False) %} {{ _("Dependency Problems") }} {% elif job.is_pending() %} {{ _("Pending") }}