Skip to content
Snippets Groups Projects
Commit b04cf0e7 authored by Łukasz Olucha's avatar Łukasz Olucha
Browse files

Fix for missed cronjobs history cleanup

parent 8352a97e
Branches
No related merge requests found
...@@ -353,7 +353,8 @@ class Observer ...@@ -353,7 +353,8 @@ class Observer
$now = time(); $now = time();
/** @var Schedule $record */ /** @var Schedule $record */
foreach ($history as $record) { foreach ($history as $record) {
if (strtotime($record->getExecutedAt()) < $now - $historyLifetimes[$record->getStatus()]) { $checkTime = strtotime($record->getExecutedAt() ? $record->getExecutedAt() : $record->getScheduledAt());
if ($checkTime < $now - $historyLifetimes[$record->getStatus()]) {
$record->delete(); $record->delete();
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment