From 30cfdac8f270df6cee890e25b0c54b60e553a298 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Thu, 23 Mar 2023 19:13:52 +0200 Subject: [PATCH] Fix project preview completed_tasks_24h should not count tasks that are marked as failed or running --- apiserver/bll/project/project_bll.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apiserver/bll/project/project_bll.py b/apiserver/bll/project/project_bll.py index c30f776..4bdd743 100644 --- a/apiserver/bll/project/project_bll.py +++ b/apiserver/bll/project/project_bll.py @@ -405,6 +405,18 @@ class ProjectBLL: "$completed", {"$gt": ["$completed", time_thresh]}, additional_cond, + { + "$not": { + "$in": [ + "$status", + [ + TaskStatus.queued, + TaskStatus.in_progress, + TaskStatus.failed, + ], + ] + } + }, ] }, "then": 1,