Add the possibility to schedule another run of the same step (progress)
[MAILPOET-5569]
This commit is contained in:
@@ -22,6 +22,12 @@ class StepScheduler {
|
||||
$this->automationRunStorage = $automationRunStorage;
|
||||
}
|
||||
|
||||
public function scheduleProgress(StepRunArgs $args, int $timestamp = null): int {
|
||||
$runId = $args->getAutomationRun()->getId();
|
||||
$data = $this->getActionData($runId, $args->getStep()->getId(), $args->getRunNumber() + 1);
|
||||
return $this->scheduleStepAction($data, $timestamp);
|
||||
}
|
||||
|
||||
public function scheduleNextStep(StepRunArgs $args, int $timestamp = null): int {
|
||||
$runId = $args->getAutomationRun()->getId();
|
||||
|
||||
@@ -58,6 +64,16 @@ class StepScheduler {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function hasScheduledProgress(StepRunArgs $args): bool {
|
||||
$runId = $args->getAutomationRun()->getId();
|
||||
$data = $this->getActionData($runId, $args->getStep()->getId(), $args->getRunNumber() + 1);
|
||||
return $this->actionScheduler->hasScheduledAction(Hooks::AUTOMATION_STEP, $data);
|
||||
}
|
||||
|
||||
public function hasScheduledStep(StepRunArgs $args): bool {
|
||||
return $this->hasScheduledNextStep($args) || $this->hasScheduledProgress($args);
|
||||
}
|
||||
|
||||
private function scheduleStepAction(array $data, int $timestamp = null): int {
|
||||
return $timestamp === null
|
||||
? $this->actionScheduler->enqueue(Hooks::AUTOMATION_STEP, $data)
|
||||
|
Reference in New Issue
Block a user