mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10602] Avoid a race condition.
PHPBB3-10602
This commit is contained in:
parent
03f819862f
commit
1e50116c54
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue