Skip to content
Snippets Groups Projects

Calcq in activity update

Merged Nico Vermaas requested to merge calcq-in-activity-update into master
5 files
+ 6
30
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -76,10 +76,9 @@ def update_activity(task):
@@ -76,10 +76,9 @@ def update_activity(task):
and improves overall performance
and improves overall performance
- to 'ARCHIVING, ARCHIVED, FINISHED' : check for incoming/existing 'archive' json from archiver
- to 'ARCHIVING, ARCHIVED, FINISHED' : check for incoming/existing 'archive' json from archiver
- to STORED : calculate quality
- to SCRUBBED, ARCHIVING, ARCHIVED, FINISHED : calculate ingested_fraction
- to SCRUBBED, ARCHIVING, ARCHIVED, FINISHED : calculate ingested_fraction
- to _FAILED : calculate finished_fraction
- to _FAILED : calculate finished_fraction
- to STORED, PROCESSED, DISCARDED : check if all tasks are processed, set Activity to is_processed and AGGREGATE
- to (processed_statusses) : check if all tasks are processed, set Activity to is_processed and AGGREGATE
- always : determine if a task is in a 'verified' status
- always : determine if a task is in a 'verified' status
"""
"""
@@ -88,14 +87,6 @@ def update_activity(task):
@@ -88,14 +87,6 @@ def update_activity(task):
activity = task.activity
activity = task.activity
# depending on the status transition, perform calculations
# depending on the status transition, perform calculations
if task.status == State.STORED.value:
logger.info(f'- calculate_qualities')
# quality is calculated per task and per sas_id, reget the quality per sas_id
try:
activity.calculated_quality = task.calculated_qualities['per_sasid']
activity.save()
except:
pass
# calculate the fraction and list of statusses of ingested tasks of this SAS_ID
# calculate the fraction and list of statusses of ingested tasks of this SAS_ID
if task.status in [State.SCRUBBED.value, State.PRE_ARCHIVING.value, State.PRE_ARCHIVED.value,
if task.status in [State.SCRUBBED.value, State.PRE_ARCHIVING.value, State.PRE_ARCHIVED.value,
Loading