Skip to content

Commit

Permalink
cli: add pending workflows to status summary
Browse files Browse the repository at this point in the history
  • Loading branch information
audrium committed Apr 22, 2021
1 parent b074a23 commit 50f6f2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion reana_server/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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(),
}
Expand Down

0 comments on commit 50f6f2a

Please sign in to comment.