Skip to content

Commit b6e4c5f

Browse files
committed
Merge pull request #1052 from LukeOl/missed_cronjobs_history_cleanup_fix
Fix for missed cronjobs history cleanup
2 parents 9609312 + b04cf0e commit b6e4c5f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/code/Magento/Cron/Model/Observer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ protected function _cleanup($groupId)
353353
$now = time();
354354
/** @var Schedule $record */
355355
foreach ($history as $record) {
356-
if (strtotime($record->getExecutedAt()) < $now - $historyLifetimes[$record->getStatus()]) {
356+
$checkTime = strtotime($record->getExecutedAt() ? $record->getExecutedAt() : $record->getScheduledAt());
357+
if ($checkTime < $now - $historyLifetimes[$record->getStatus()]) {
357358
$record->delete();
358359
}
359360
}

0 commit comments

Comments
 (0)