aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-12-05 00:41:47 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-12-05 00:41:47 -0500
commit03f819862f15efa2ef64331b23394086746d09be (patch)
treedf5769e73836a483f9bebe48e7b685a0e04c62dd
parent58a7050fac0f9a2b3f9deea717c01cba98fdb38f (diff)
downloadforums-03f819862f15efa2ef64331b23394086746d09be.tar
forums-03f819862f15efa2ef64331b23394086746d09be.tar.gz
forums-03f819862f15efa2ef64331b23394086746d09be.tar.bz2
forums-03f819862f15efa2ef64331b23394086746d09be.tar.xz
forums-03f819862f15efa2ef64331b23394086746d09be.zip
[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
-rw-r--r--phpBB/includes/functions_messenger.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 6549693333..ae0f7823cc 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -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)