mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 22:38:52 +00:00
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/10602] Avoid a race condition. [ticket/10602] Use last_queue_run for its intended purpose. Conflicts: phpBB/includes/functions_messenger.php
This commit is contained in:
commit
4f947ebb47
1 changed files with 10 additions and 3 deletions
|
@ -661,14 +661,21 @@ class queue
|
||||||
$lock = new phpbb_lock_flock($this->cache_file);
|
$lock = new phpbb_lock_flock($this->cache_file);
|
||||||
$lock->acquire();
|
$lock->acquire();
|
||||||
|
|
||||||
set_config('last_queue_run', time(), true);
|
// avoid races, check file existence once
|
||||||
|
$have_cache_file = file_exists($this->cache_file);
|
||||||
if (!file_exists($this->cache_file) || filemtime($this->cache_file) > time() - $config['queue_interval'])
|
if (!$have_cache_file || $config['last_queue_run'] > time() - $config['queue_interval'])
|
||||||
{
|
{
|
||||||
|
if (!$have_cache_file)
|
||||||
|
{
|
||||||
|
set_config('last_queue_run', time(), true);
|
||||||
|
}
|
||||||
|
|
||||||
$lock->release();
|
$lock->release();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_config('last_queue_run', time(), true);
|
||||||
|
|
||||||
include($this->cache_file);
|
include($this->cache_file);
|
||||||
|
|
||||||
foreach ($this->queue_data as $object => $data_ary)
|
foreach ($this->queue_data as $object => $data_ary)
|
||||||
|
|
Loading…
Add table
Reference in a new issue