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

Task #10339: apparently people change the status of (pre)scheduled/queued...

Task #10339: apparently people change the status of (pre)scheduled/queued tasks in mom back to openend, so we should check these too and remove them if status=^Cenend in mom.
parent 98ce9c0c
No related branches found
No related tags found
No related merge requests found
...@@ -167,14 +167,14 @@ class ScheduleChecker(): ...@@ -167,14 +167,14 @@ class ScheduleChecker():
except Exception as e: except Exception as e:
logger.error("Error while checking scheduled pipelines: %s", e) logger.error("Error while checking scheduled pipelines: %s", e)
def checkApprovedTasks(self): def checkUnRunTasksForMoMOpenedStatus(self):
try: try:
logger.info('checking approved tasks for status in mom') logger.info('checking approved tasks for status in mom')
approved_tasks = self._radbrpc.getTasks(task_status='approved') unrun_tasks = self._radbrpc.getTasks(task_status=['approved', 'scheduled', 'prescheduled', 'queued'])
mom_ids = [t['mom_id'] for t in approved_tasks] mom_ids = [t['mom_id'] for t in unrun_tasks]
mom_details = self._momrpc.getProjectDetails(mom_ids) mom_details = self._momrpc.getProjectDetails(mom_ids)
for task in approved_tasks: for task in unrun_tasks:
mom_id = int(task['mom_id']) mom_id = int(task['mom_id'])
if (mom_id not in mom_details or if (mom_id not in mom_details or
mom_details[mom_id]['object_status'] == 'opened'): mom_details[mom_id]['object_status'] == 'opened'):
...@@ -200,7 +200,7 @@ class ScheduleChecker(): ...@@ -200,7 +200,7 @@ class ScheduleChecker():
while self._running: while self._running:
self.checkRunningPipelines() self.checkRunningPipelines()
self.checkScheduledAndQueuedPipelines() self.checkScheduledAndQueuedPipelines()
self.checkApprovedTasks() self.checkUnRunTasksForMoMOpenedStatus()
for i in range(PIPELINE_CHECK_INTERVAL): for i in range(PIPELINE_CHECK_INTERVAL):
sleep(1) sleep(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment