From 58cea137075e88a6e86712d3603f8233d7adb56f Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 21 May 2014 07:28:33 +0200 Subject: [PATCH] Cron/Queue: Setting a limit to avoid endless PHP jobs. --- include/cronhooks.php | 5 ++++- include/queue.php | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/cronhooks.php b/include/cronhooks.php index cf1d13765f..d5daf0d7d4 100644 --- a/include/cronhooks.php +++ b/include/cronhooks.php @@ -50,11 +50,14 @@ function cronhooks_run(&$argv, &$argc){ logger('cronhooks: start'); - $d = datetime_convert(); + set_time_limit(9*60*60); // Setting the maximum execution time for cronjobs to 9 minutes. + call_hooks('cron', $d); + logger('cronhooks: end'); + return; } diff --git a/include/queue.php b/include/queue.php index 4825eb8a4d..7fb6c6d90a 100644 --- a/include/queue.php +++ b/include/queue.php @@ -106,6 +106,8 @@ function queue_run(&$argv, &$argc){ logger('queue: start'); + set_time_limit(9*60*60); // Setting the maximum execution time for queue job to 9 minutes. + handle_pubsubhubbub(); $interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval'))); -- 2.39.5