unify call pattern for get_tasks

This commit is contained in:
Elijah DeLee 2022-07-11 10:26:04 -04:00 committed by Seth Foster
parent 76d76d13b0
commit bf89093fac
No known key found for this signature in database
GPG Key ID: 86E90D96F7184028

View File

@ -275,12 +275,12 @@ class WorkflowManager(TaskBase):
task.save(update_fields=['status', 'job_explanation', 'timed_out'])
@timeit
def get_tasks(self):
self.all_tasks = [wf for wf in WorkflowJob.objects.filter(status='running')]
def get_tasks(self, filter_args):
self.all_tasks = [wf for wf in WorkflowJob.objects.filter(**filter_args)]
@timeit
def _schedule(self):
self.get_tasks()
self.get_tasks(dict(status__in=["running"], dependencies_processed=True))
if len(self.all_tasks) > 0:
self.spawn_workflow_graph_jobs()
self.timeout_approval_node()