From 07a910ede989af178d98c92aff7080bc027a06ce Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 5 May 2014 17:10:24 -0400 Subject: Issue #2021933 by Crell, David_Rothstein, joachim, lz1irq: Catch exceptions from queue workers. --- includes/common.inc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'includes/common.inc') diff --git a/includes/common.inc b/includes/common.inc index a443158f1..1c55f347c 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -5294,8 +5294,15 @@ function drupal_cron_run() { $end = time() + (isset($info['time']) ? $info['time'] : 15); $queue = DrupalQueue::get($queue_name); while (time() < $end && ($item = $queue->claimItem())) { - $function($item->data); - $queue->deleteItem($item); + try { + $function($item->data); + $queue->deleteItem($item); + } + catch (Exception $e) { + // In case of exception log it and leave the item in the queue + // to be processed again later. + watchdog_exception('cron', $e); + } } } // Restore the user. -- cgit v1.2.3