Skip to content
Snippets Groups Projects
Commit 59d557a2 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #10339: yet another mom dp status to take into account when counting ingestable dataproducts

parent 5fad4811
No related branches found
No related tags found
No related merge requests found
...@@ -91,6 +91,7 @@ def updateTaskMomDetails(task, momrpc): ...@@ -91,6 +91,7 @@ def updateTaskMomDetails(task, momrpc):
num_ingest_running = 0 num_ingest_running = 0
num_ingest_failed = 0 num_ingest_failed = 0
num_ingest_hold = 0 num_ingest_hold = 0
num_ingest_aborted = 0
for dp in dps: for dp in dps:
if dp['status'] == 'ingested': if dp['status'] == 'ingested':
num_ingested += 1 num_ingested += 1
...@@ -102,14 +103,16 @@ def updateTaskMomDetails(task, momrpc): ...@@ -102,14 +103,16 @@ def updateTaskMomDetails(task, momrpc):
num_ingest_failed += 1 num_ingest_failed += 1
elif dp['status'] == 'on_hold': elif dp['status'] == 'on_hold':
num_ingest_hold += 1 num_ingest_hold += 1
elif dp['status'] == 'aborted':
num_ingest_aborted += 1
ingestable_dataproducts = [dp for dp in dps if dp['status'] not in [None, 'has_data', 'no_data', 'aborted'] ] ingestable_dataproducts = [dp for dp in dps if dp['status'] not in [None, 'has_data', 'no_data'] ]
if ingestable_dataproducts > 0 and num_ingested == len(ingestable_dataproducts): if num_ingested > 0 and num_ingested == len(ingestable_dataproducts):
t['ingest_status'] = 'ingested' t['ingest_status'] = 'ingested'
elif num_ingest_pending + num_ingest_running > 0: elif num_ingest_pending + num_ingest_running > 0:
t['ingest_status'] = 'ingesting' t['ingest_status'] = 'ingesting'
elif num_ingest_failed + num_ingest_hold > 0: elif num_ingest_failed + num_ingest_aborted + num_ingest_hold > 0:
t['ingest_status'] = 'failed' t['ingest_status'] = 'failed'
except Exception as e: except Exception as e:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment