|
12 | 12 | from galaxy import model |
13 | 13 | from galaxy.exceptions import HandlerAssignmentError |
14 | 14 | from galaxy.jobs.handler import InvocationGrabber |
| 15 | +from galaxy.model.orm.now import now |
15 | 16 | from galaxy.schema.invocation import ( |
16 | 17 | FailureReason, |
17 | 18 | InvocationFailureDatasetFailed, |
@@ -341,12 +342,12 @@ def ready_to_schedule_more(self, invocation: model.WorkflowInvocation): |
341 | 342 | invocation_step_update_time := invocation.get_last_workflow_invocation_step_update_time() |
342 | 343 | ): |
343 | 344 | do_schedule = invocation_step_update_time > last_schedule_time |
344 | | - if not do_schedule and (datetime.now() - last_schedule_time) > self.timedelta: |
| 345 | + if not do_schedule and (now() - last_schedule_time) > self.timedelta: |
345 | 346 | # If we haven't scheduled in a while, schedule anyway. |
346 | 347 | log.debug( |
347 | 348 | "Scheduling workflow invocation [%s] after %s seconds without scheduling.", |
348 | 349 | invocation.id, |
349 | | - (datetime.now() - last_schedule_time).total_seconds(), |
| 350 | + (now() - last_schedule_time).total_seconds(), |
350 | 351 | ) |
351 | 352 | do_schedule = True |
352 | 353 | return do_schedule |
@@ -449,7 +450,7 @@ def __attempt_schedule(self, invocation_id, workflow_scheduler): |
449 | 450 | if i.active and i.id < workflow_invocation.id: |
450 | 451 | return False |
451 | 452 | if self.ready_to_schedule_more(workflow_invocation): |
452 | | - self.update_time_tracking_dict[invocation_id] = datetime.now() |
| 453 | + self.update_time_tracking_dict[invocation_id] = now() |
453 | 454 | workflow_scheduler.schedule(workflow_invocation) |
454 | 455 | log.debug("Workflow invocation [%s] scheduled", invocation_id) |
455 | 456 | except Exception: |
|
0 commit comments