From 50f6f2a050f98749b4cd333dc1cd894034d59462 Mon Sep 17 00:00:00 2001 From: Audrius Mecionis Date: Wed, 21 Apr 2021 15:01:55 +0200 Subject: [PATCH] cli: add pending workflows to status summary closes https://github.com/reanahub/reana-workflow-controller/issues/363 --- reana_server/status.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reana_server/status.py b/reana_server/status.py index 47ffe3d1..a2ca5305 100644 --- a/reana_server/status.py +++ b/reana_server/status.py @@ -236,7 +236,7 @@ def stuck_workflows(self): inactivity_threshold = datetime.now() - timedelta(hours=12) number = ( Session.query(Workflow) - .filter(Workflow.status == RunStatus.running) + .filter(Workflow.status.in_([RunStatus.running, RunStatus.pending])) .filter(Workflow.run_started_at <= inactivity_threshold) .filter(Workflow.updated <= inactivity_threshold) .count() @@ -257,6 +257,7 @@ def get_status(self): "finished": self.get_workflows_by_status(RunStatus.finished), "stuck": self.stuck_workflows(), "queued": self.get_workflows_by_status(RunStatus.queued), + "pending": self.get_workflows_by_status(RunStatus.pending), "restarts": self.restarted_workflows(), "git_source": self.git_workflows(), }