Skip to content

Commit 5927a75

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-83782: [2.2] Cron_schedule forever increasing in size. Lots of pending jobs never cleared
1 parent 03bb798 commit 5927a75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
227227
if ($schedule->tryLockJob()) {
228228
$this->_runJob($scheduledTime, $currentTime, $jobConfig, $schedule, $groupId);
229229
}
230-
} catch (\Exception $e) {
230+
} catch (\Throwable $e) {
231231
$schedule->setMessages($e->getMessage());
232232
if ($schedule->getStatus() === Schedule::STATUS_ERROR) {
233233
$this->logger->critical($e);
@@ -259,7 +259,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
259259
* @param Schedule $schedule
260260
* @param string $groupId
261261
* @return void
262-
* @throws \Exception
262+
* @throws \Throwable
263263
*/
264264
protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule, $groupId)
265265
{
@@ -290,7 +290,7 @@ protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule,
290290

291291
try {
292292
call_user_func_array($callback, [$schedule]);
293-
} catch (\Exception $e) {
293+
} catch (\Throwable $e) {
294294
$schedule->setStatus(Schedule::STATUS_ERROR);
295295
throw $e;
296296
}

0 commit comments

Comments
 (0)