From 1ce2cf8bf7706972c736d462c8bb1af358b94dc1 Mon Sep 17 00:00:00 2001 From: Vermaas <vermaas@astron.nl> Date: Mon, 8 Apr 2024 09:51:18 +0200 Subject: [PATCH] add service filter for logentry --- atdb/taskdatabase/models.py | 13 +++++++------ atdb/taskdatabase/views.py | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/atdb/taskdatabase/models.py b/atdb/taskdatabase/models.py index e8a681ef..7624c0d3 100644 --- a/atdb/taskdatabase/models.py +++ b/atdb/taskdatabase/models.py @@ -233,19 +233,20 @@ class Task(models.Model): # when a task goes to PROCESSED... if (self.status != State.PROCESSED.value) & (self.new_status == State.PROCESSED.value): - # only when the tasks are not yet aggregated - if self.activity.status != State.AGGREGATED.value: + # ...but only when the tasks of this activity are not yet aggregated + # (because the aggregator service also sets tasks back to processed) + + if (self.activity.status != State.AGGREGATED.value): # check if this task is a summary task self.is_summary = check_if_summary(self) - # if so, temporarily put it on hold so that the ancillary service can play with it + # if so, temporarily put it on hold so that the ancillary service can grab it with it if self.is_summary: # slightly bothered by the idea that ATDB puts it on HOLD and depends on the ancillary service # to resume it. But users have earlier asked for the same dynamic for scrubbed. Acceptable - - # TODO: uncomment this, but I don't want to have it accidentally active without - # the summary service available and running to resume it. + # TODO: (un)comment this + # We don't want ATDB holding tasks without a aggregator service in place to resume self.resume = False # TODO: Q: should ATDB do this? or the aggregator service? diff --git a/atdb/taskdatabase/views.py b/atdb/taskdatabase/views.py index b80e2361..0733a6e3 100644 --- a/atdb/taskdatabase/views.py +++ b/atdb/taskdatabase/views.py @@ -155,6 +155,7 @@ class LogEntryFilter(filters.FilterSet): fields = { 'task__id': ['exact'], + 'service': ['exact', 'icontains', 'in'], 'step_name': ['exact', 'icontains', 'in', 'startswith'], 'status': ['exact', 'in'], } -- GitLab