mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/10602] Avoid a race condition.
PHPBB3-10602
This commit is contained in:
@@ -715,9 +715,11 @@ class queue
|
||||
|
||||
$lock_fp = $this->lock();
|
||||
|
||||
if (!file_exists($this->cache_file) || $config['last_queue_run'] > time() - $config['queue_interval'])
|
||||
// avoid races, check file existence once
|
||||
$have_cache_file = file_exists($this->cache_file);
|
||||
if (!$have_cache_file || $config['last_queue_run'] > time() - $config['queue_interval'])
|
||||
{
|
||||
if (!file_exists($this->cache_file))
|
||||
if (!$have_cache_file)
|
||||
{
|
||||
set_config('last_queue_run', time(), true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user