Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
atdb-ldv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON SDC
atdb-ldv
Commits
6ccbc362
Commit
6ccbc362
authored
7 months ago
by
Nico Vermaas
Browse files
Options
Downloads
Patches
Plain Diff
create a new aggregation task when the old one of a SAS_ID was discarded
parent
21322434
No related branches found
No related tags found
1 merge request
!381
Sdc 1607 bugfix discard repurpose aggregation
Pipeline
#100058
failed
7 months ago
Stage: test
Stage: build
Stage: deploy_to_test
Stage: deploy_to_production
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
atdb/taskdatabase/services/activities_handler.py
+26
-2
26 additions, 2 deletions
atdb/taskdatabase/services/activities_handler.py
atdb/taskdatabase/tables.py
+2
-3
2 additions, 3 deletions
atdb/taskdatabase/tables.py
with
28 additions
and
5 deletions
atdb/taskdatabase/services/activities_handler.py
+
26
−
2
View file @
6ccbc362
...
...
@@ -228,7 +228,7 @@ def update_processed_and_aggregate(task):
if
not
(
'
fail
'
in
activity
.
status
):
# create a new 'aggregate_task' that is used to collect the aggregated output
# this has to be done only once, so this is a good place to do it.
if
Task
.
objects
.
filter
(
sas_id
=
task
.
sas_id
,
task_type
=
'
aggregation
'
).
count
()
==
0
:
if
Task
.
objects
.
filter
(
sas_id
=
task
.
sas_id
,
task_type
=
'
aggregation
'
).
exclude
(
status__icontains
=
'
discard
'
).
count
()
==
0
:
create_aggregation_task
(
task
)
logger
.
info
(
f
'
- created aggregation task:
{
task
.
id
}
'
)
...
...
@@ -329,6 +329,27 @@ def update_service_filter(task):
activity
.
service_filter
=
task
.
service_filter
activity
.
save
()
def
update_discard
(
task
):
"""
when all tasks of this sas_id are discarded, then reset the activity
because the most probably usecase is that it will be used again by a new batch of tasks
"""
activity
=
task
.
activity
for
t
in
Task
.
objects
.
filter
(
sas_id
=
task
.
sas_id
,
task_type
=
'
regular
'
):
if
t
.
status
not
in
[
State
.
DISCARD
.
value
,
State
.
DISCARDED
.
value
]:
return
# everything is DISCARDED
activity
.
project
=
None
activity
.
filter
=
None
activity
.
status
=
"
reset
"
activity
.
is_verified
=
False
activity
.
is_processed
=
False
activity
.
is_aggregated
=
False
activity
.
service_filter
=
None
activity
.
save
()
def
update_activity
(
task
):
"""
...
...
@@ -379,3 +400,6 @@ def update_activity(task):
# check if this activity has a 'service_filter', if not, use the one from the task
update_service_filter
(
task
)
# if all tasks of this activity are discarded, then reset the activity
update_discard
(
task
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
atdb/taskdatabase/tables.py
+
2
−
3
View file @
6ccbc362
...
...
@@ -51,11 +51,10 @@ class TaskTable(tables.Table):
class
Meta
:
model
=
Task
template_name
=
"
django_tables2/bootstrap4.html
"
fields
=
(
"
id
"
,
"
type
"
,
"
WF
"
,
"
filter
"
,
"
service_filter
"
,
"
priority
"
,
"
status
"
,
"
quality
"
,
"
project
"
,
"
sas_id
"
,
"
resume
"
,
"
purge
"
,
"
actions
"
,
"
buttons
"
)
fields
=
(
"
id
"
,
"
task_
type
"
,
"
WF
"
,
"
filter
"
,
"
service_filter
"
,
"
priority
"
,
"
status
"
,
"
quality
"
,
"
project
"
,
"
sas_id
"
,
"
resume
"
,
"
purge
"
,
"
actions
"
,
"
buttons
"
)
# columns that need specific rendering
type
=
TypeColumn
()
WF
=
WorkflowColumn
()
#orkflowColumn()
status
=
StatusColumn
()
purge
=
PurgeColumn
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment