MCPcopy Index your code
hub / github.com/coleifer/huey / execute

Method execute

huey/api.py:414–435  ·  view source on GitHub ↗
(self, task, timestamp=None)

Source from the content-addressed store, hash-verified

412 datetime.datetime.now())
413
414 def execute(self, task, timestamp=None):
415 if timestamp is None:
416 timestamp = self._get_timestamp()
417
418 if not self.ready_to_run(task, timestamp):
419 self.add_schedule(task)
420 elif self.is_revoked(task, timestamp, False):
421 logger.warning('Task %s was revoked, not executing', task)
422 self._emit(S.SIGNAL_REVOKED, task)
423 if task.chord_config is not None:
424 # Contribute a placeholder result for the skipped task so the
425 # chord callback can still fire when the rest are done.
426 self._check_chord(task, None)
427 elif task.expires_resolved and task.expires_resolved < timestamp:
428 logger.info('Task %s expired, not executing.', task)
429 self._emit(S.SIGNAL_EXPIRED, task)
430 if task.chord_config is not None:
431 self._check_chord(task, None)
432 else:
433 logger.info('Executing %s', task)
434 self._emit(S.SIGNAL_EXECUTING, task)
435 return self._execute(task, timestamp)
436
437 def _execute(self, task, timestamp):
438 if self._pre_execute:

Callers 15

enqueueMethod · 0.95
put_dataMethod · 0.45
peek_dataMethod · 0.45
pop_dataMethod · 0.45
put_dataMethod · 0.45
peek_dataMethod · 0.45
dbMethod · 0.45
initialize_schemaMethod · 0.45
sqlMethod · 0.45
_create_connectionMethod · 0.45
dequeueMethod · 0.45
read_scheduleMethod · 0.45

Calls 7

_get_timestampMethod · 0.95
ready_to_runMethod · 0.95
add_scheduleMethod · 0.95
is_revokedMethod · 0.95
_emitMethod · 0.95
_check_chordMethod · 0.95
_executeMethod · 0.95

Tested by 15

test_swap_immediateMethod · 0.36
test_timeoutMethod · 0.36
run_nextMethod · 0.36
test_priority_retryMethod · 0.36
test_workflowMethod · 0.36
test_schedulingMethod · 0.36
test_schedule_sMethod · 0.36
test_revoke_taskMethod · 0.36