1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 15:16:16 +02:00

Merge pull request #2490 from Nicofuma/ticket/12585

[ticket/12585] Don't check the cron on each page load

* Nicofuma/ticket/12585:
  [ticket/12585] Use a 5 minutes interval instead of 10 minutes
  [ticket/12585] Don't check the cron on each page load
This commit is contained in:
Andreas Fischer 2014-05-24 11:55:32 +02:00
commit 42bc2612c4

View File

@ -5095,7 +5095,7 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
// Call cron-type script
$call_cron = false;
if (!defined('IN_CRON') && !$config['use_system_cron'] && $run_cron && !$config['board_disable'] && !$user->data['is_bot'])
if (!defined('IN_CRON') && !$config['use_system_cron'] && $run_cron && !$config['board_disable'] && !$user->data['is_bot'] && !$cache->get('cron.lock_check'))
{
$call_cron = true;
$time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time();
@ -5125,6 +5125,10 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
$url = $task->get_url();
$template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />');
}
else
{
$cache->put('cron.lock_check', true, 300);
}
}
if ($display_template)