Skip to content

Commit

Permalink
Merge pull request #1052 from LukeOl/missed_cronjobs_history_cleanup_fix
Browse files Browse the repository at this point in the history
Fix for missed cronjobs history cleanup
  • Loading branch information
vrann committed Mar 20, 2015
2 parents 9609312 + b04cf0e commit b6e4c5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/code/Magento/Cron/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ protected function _cleanup($groupId)
$now = time();
/** @var Schedule $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();
}
}
Expand Down

0 comments on commit b6e4c5f

Please sign in to comment.