Drupal: Quick Diagnostics of Cron Hanging Up
Solution
Idexing
Decrease number of documents for indexing at one cron launching on the page of search settings.
It’s better to run cron a few times a day.
Mailing
If you have simple news then it can cause hanging up when sending a huge number of emails.
Have no time
Try to change cron.php file with the following way:
// If not in ‘safe mode’, increase the maximum execution time:
// if (!ini_get(‘safe_mode’)) {
set_time_limit(1800);
// }
i.e. comment these lines.
Who is in fault?
To define the module causing cron hanging up, do the following:
Change line 404-405 in the last function module_invoke_all() in includes/module.inc file from
foreach (module_implements($hook) as $module) {
$function = $module .’_’. $hook;
to
foreach (module_implements($hook) as $module) {
if ($hook == ‘cron’) {
watchdog(‘cron_runs’, $module); }
$function = $module .’_’. $hook;
Thus new category "cron_runs" will appear in log
This category will contains the list of modules called cron. The last module is in fault of cron hanging up.
It is necessary to reset core files after diagnostics.