Set task status to invalid instead of deleting

[MAILPOET-3359]
This commit is contained in:
wxa
2021-03-08 14:10:48 +03:00
committed by Veljko V
parent a0ad4ffb20
commit 67824f9eb1
4 changed files with 8 additions and 3 deletions

View File

@@ -108,10 +108,11 @@ class Sending {
public static function handleInvalidTask(ScheduledTask $task) {
$loggerFactory = LoggerFactory::getInstance();
$loggerFactory->getLogger(LoggerFactory::TOPIC_NEWSLETTERS)->addError(
'invalid sending task found, deleting',
'invalid sending task found',
['task_id' => $task->id]
);
$task->delete();
$task->status = ScheduledTask::STATUS_INVALID;
$task->save();
}
public static function createFromScheduledTask(ScheduledTask $task) {