From 3379da9d7008c327115f49c47c2436e1e8ee73cd Mon Sep 17 00:00:00 2001 From: webchick Date: Tue, 30 Aug 2011 01:07:28 -0700 Subject: Issue #978944 by Aron Novak, chx, ksenzee: Fixed Handle exceptions thrown in cron. --- includes/common.inc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 2f877ac2d..cbfdabb19 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -5040,7 +5040,15 @@ function drupal_cron_run() { drupal_register_shutdown_function('drupal_cron_cleanup'); // Iterate through the modules calling their cron handlers (if any): - module_invoke_all('cron'); + foreach (module_implements('cron') as $module) { + // Do not let an exception thrown by one module disturb another. + try { + module_invoke($module, 'cron'); + } + catch (Exception $e) { + watchdog_exception('cron', $e); + } + } // Record cron time variable_set('cron_last', REQUEST_TIME); -- cgit v1.2.3