#833094 by carlos8f, David_Rothstein: Fixed Ajax requests in installer cause cron to run prematurely.

merge-requests/26/head
Angie Byron 2010-06-24 17:28:10 +00:00
parent 2d9fd20acc
commit 8c390590d9
1 changed files with 4 additions and 1 deletions

View File

@ -3283,7 +3283,10 @@ function system_page_alter(&$page) {
* Run the automated cron if enabled.
*/
function system_run_automated_cron() {
if (($threshold = variable_get('cron_safe_threshold', DRUPAL_CRON_DEFAULT_THRESHOLD)) > 0) {
// If the site is not fully installed, suppress the automated cron run.
// Otherwise it could be triggered prematurely by AJAX requests during
// installation.
if (($threshold = variable_get('cron_safe_threshold', DRUPAL_CRON_DEFAULT_THRESHOLD)) > 0 && variable_get('install_task') == 'done') {
$cron_last = variable_get('cron_last', NULL);
if (!isset($cron_last) || (REQUEST_TIME - $cron_last > $threshold)) {
drupal_cron_run();