1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 23:25:30 +02:00

[ticket/10602] Use last_queue_run for its intended purpose.

We keep the last queue run time around, therefore for determining
whether enough time has passed since the last run we can simply
use this config variable.

When there is no queue file we consider a queue run successful.

Previously queue.php ("cache file") modification time would be used
for determining whether enough time has passed since last queue run.
The problem was that modification time would be updated whenever
anything was added to the queue, creating a situation where if
queue is processed less frequently than it is added to that email
would not be sent.

PHPBB3-10602
This commit is contained in:
Oleg Pudeyev 2012-12-05 00:41:47 -05:00
parent 58a7050fac
commit 03f819862f

View File

@ -715,14 +715,19 @@ class queue
$lock_fp = $this->lock();
set_config('last_queue_run', time(), true);
if (!file_exists($this->cache_file) || filemtime($this->cache_file) > time() - $config['queue_interval'])
if (!file_exists($this->cache_file) || $config['last_queue_run'] > time() - $config['queue_interval'])
{
if (!file_exists($this->cache_file))
{
set_config('last_queue_run', time(), true);
}
$this->unlock($lock_fp);
return;
}
set_config('last_queue_run', time(), true);
include($this->cache_file);
foreach ($this->queue_data as $object => $data_ary)