Log step key data

[MAILPOET-5568]
This commit is contained in:
Jan Jakes
2023-09-04 13:12:58 +02:00
committed by Aschepikov
parent 370f4ee3ae
commit a13dc71cd0
2 changed files with 11 additions and 2 deletions

View File

@ -4,6 +4,7 @@ namespace MailPoet\Automation\Engine\Control;
use DateTimeImmutable;
use MailPoet\Automation\Engine\Data\AutomationRunLog;
use MailPoet\Automation\Engine\Data\Step;
use MailPoet\Automation\Engine\Hooks;
use MailPoet\Automation\Engine\Storage\AutomationRunLogStorage;
use MailPoet\InvalidStateException;
@ -46,6 +47,12 @@ class StepRunLogger {
$this->getLog();
}
public function logStepData(Step $step): void {
$log = $this->getLog();
$log->setStepKey($step->getKey());
$this->automationRunLogStorage->updateAutomationRunLog($log);
}
public function logSuccess(): void {
$log = $this->getLog();
$log->setStatus(AutomationRunLog::STATUS_COMPLETE);