summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/common.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 3b353756c..78f2fc4ae 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -3032,8 +3032,10 @@ function drupal_cron_run() {
// Allow execution to continue even if the request gets canceled.
@ignore_user_abort(TRUE);
- // Increase the maximum execution time.
- @set_time_limit(240);
+ // Try to increase the maximum execution time if it is too low.
+ if (ini_get('max_execution_time') < 240) {
+ @set_time_limit(240);
+ }
// Fetch the cron semaphore
$semaphore = variable_get('cron_semaphore', FALSE);