summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2014-05-05 17:10:24 -0400
committerDavid Rothstein <drothstein@gmail.com>2014-05-05 17:10:24 -0400
commit07a910ede989af178d98c92aff7080bc027a06ce (patch)
tree980bd90370f2ba1d32e5dc1a5d569b3c3aa517ec /includes/common.inc
parent808a61aef282f43f55bf9d8db1de8d947f32e357 (diff)
downloadbrdo-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.inc11
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.