aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-09-01 11:39:59 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-09-01 11:39:59 +0000
commit714aa8b09a62994ad4777d30064b72c90e84b442 (patch)
treec53624612999f78bfdcb7557bf888b5b96fd424a /phpBB/includes/functions.php
parentd65ccbde11efe8dba2b4cdf838903938399cd045 (diff)
downloadforums-714aa8b09a62994ad4777d30064b72c90e84b442.tar
forums-714aa8b09a62994ad4777d30064b72c90e84b442.tar.gz
forums-714aa8b09a62994ad4777d30064b72c90e84b442.tar.bz2
forums-714aa8b09a62994ad4777d30064b72c90e84b442.tar.xz
forums-714aa8b09a62994ad4777d30064b72c90e84b442.zip
Only embed cron.php if there is no cron lock present to reduce overhead. (Bug #45725 - Patch by TerryE)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10082 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 6d67f87096..f18514096f 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -4284,8 +4284,27 @@ function page_footer($run_cron = true)
);
// Call cron-type script
+ $call_cron = false;
if (!defined('IN_CRON') && $run_cron && !$config['board_disable'])
{
+ $call_cron = true;
+
+ // Any old lock present?
+ if (!empty($config['cron_lock']))
+ {
+ $cron_time = explode(' ', $config['cron_lock']);
+
+ // If 1 hour lock is present we do not call cron.php
+ if ($cron_time[0] + 3600 >= time())
+ {
+ $call_cron = false;
+ }
+ }
+ }
+
+ // Call cron job?
+ if ($call_cron)
+ {
$cron_type = '';
if (time() - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))