mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-26 05:08:52 +00:00
[ticket/12585] Don't check the cron on each page load
PHPBB3-12585
This commit is contained in:
parent
a2cd9c2464
commit
c83b568848
1 changed files with 5 additions and 1 deletions
|
@ -5095,7 +5095,7 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
|
||||||
|
|
||||||
// Call cron-type script
|
// Call cron-type script
|
||||||
$call_cron = false;
|
$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;
|
$call_cron = true;
|
||||||
$time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time();
|
$time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time();
|
||||||
|
@ -5124,6 +5124,10 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
|
||||||
$url = $task->get_url();
|
$url = $task->get_url();
|
||||||
$template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />');
|
$template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />');
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$cache->put('cron.lock_check', true, 60 * 10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($display_template)
|
if ($display_template)
|
||||||
|
|
Loading…
Add table
Reference in a new issue