Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.823 diff -u -r1.823 common.inc --- includes/common.inc 10 Nov 2008 05:22:59 -0000 1.823 +++ includes/common.inc 11 Nov 2008 00:58:35 -0000 @@ -2715,6 +2715,7 @@ require_once DRUPAL_ROOT . '/includes/form.inc'; require_once DRUPAL_ROOT . '/includes/mail.inc'; require_once DRUPAL_ROOT . '/includes/actions.inc'; + // Set the Drupal custom error handler. set_error_handler('_drupal_error_handler'); set_exception_handler('_drupal_exception_handler'); @@ -2728,6 +2729,15 @@ // Load all enabled modules module_load_all(); + // Register a safe cron run at the end of the request if needed. + $cron_safe_threshold = variable_get('cron_safe_threshold', 10800); + if ($cron_safe_threshold) { + $cron_last = variable_get('cron_last', 0); + if (!$cron_last || (REQUEST_TIME - $cron_last > $cron_safe_threshold)) { + register_shutdown_function('drupal_cron_run'); + } + } + // Let all modules take action before menu system handles the request // We do not want this while running update.php. if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update') { Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.103 diff -u -r1.103 system.admin.inc --- modules/system/system.admin.inc 10 Nov 2008 05:23:00 -0000 1.103 +++ modules/system/system.admin.inc 11 Nov 2008 00:58:35 -0000 @@ -1716,6 +1716,22 @@ '#description' => t('Message to show visitors when the site is in offline mode.') ); + $form['cron_safe_threshold'] = array( + '#type' => 'select', + '#title' => t('Automatically run cron'), + '#options' => array( + 0 => t('Do not automatically run cron'), + 1800 => t('Every 30 minutes'), + 3600 => t('Every hour'), + 10800 => t('Every three hours'), + 21600 => t('Every six hours'), + 43200 => t('Every twelve hours'), + 86400 => t('Daily'), + ), + '#default_value' => variable_get('cron_safe_threshold', 10800), + '#description' => t('Automatically run cron if it has not been run for an extended period of time.'), + ); + return system_settings_form($form); } Index: profiles/expert/expert.profile =================================================================== RCS file: /cvs/drupal/drupal/profiles/expert/expert.profile,v retrieving revision 1.1 diff -u -r1.1 expert.profile --- profiles/expert/expert.profile 5 Jul 2008 10:58:12 -0000 1.1 +++ profiles/expert/expert.profile 11 Nov 2008 00:58:35 -0000 @@ -90,7 +90,10 @@ * modify the $task, otherwise discarded. */ function expert_profile_tasks(&$task, $url) { + // Disable Locale module. module_disable(array('locale')); + // Disable automated cron runs. + variable_set('cron_safe_threshold', 0); } /**