diff options
author | David Rothstein <drothstein@gmail.com> | 2014-05-05 17:10:24 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2014-05-05 17:10:24 -0400 |
commit | 07a910ede989af178d98c92aff7080bc027a06ce (patch) | |
tree | 980bd90370f2ba1d32e5dc1a5d569b3c3aa517ec /includes/common.inc | |
parent | 808a61aef282f43f55bf9d8db1de8d947f32e357 (diff) | |
download | brdo-07a910ede989af178d98c92aff7080bc027a06ce.tar.gz brdo-07a910ede989af178d98c92aff7080bc027a06ce.tar.bz2 |
Issue #2021933 by Crell, David_Rothstein, joachim, lz1irq: Catch exceptions from queue workers.
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 11 |
1 files changed, 9 insertions, 2 deletions
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. |