diff options
author | Simon L'nu <simon.lnu@gmail.com> | 2012-03-18 12:02:33 -0400 |
---|---|---|
committer | Simon L'nu <simon.lnu@gmail.com> | 2012-03-18 12:02:33 -0400 |
commit | 8b13358ce33a1d3f88dedf2d50c650017614f418 (patch) | |
tree | f3c256fb748d21440ea19a25fd2232c626fc1122 /include/queue.php | |
parent | 939c8d3c8d3dce18e136d9ddff5fb93f064c61c3 (diff) | |
parent | 09ed17df99dd3acebeba814ff19c43c6c4a512f8 (diff) | |
download | volse-hubzilla-8b13358ce33a1d3f88dedf2d50c650017614f418.tar.gz volse-hubzilla-8b13358ce33a1d3f88dedf2d50c650017614f418.tar.bz2 volse-hubzilla-8b13358ce33a1d3f88dedf2d50c650017614f418.zip |
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master:
replace split() by explode(); split is deprecated
lost changes to tinymce/bbcode
remove admin view of local directory
bug #337, call template_unescape() only at the end of template processing
queue optimisation - back off delivery attempts to once per hour after the first 12 hours.
* master:
Diffstat (limited to 'include/queue.php')
-rwxr-xr-x | include/queue.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/queue.php b/include/queue.php index d312b50f5..7e92705be 100755 --- a/include/queue.php +++ b/include/queue.php @@ -61,13 +61,18 @@ function queue_run($argv, $argc){ q("DELETE FROM `queue` WHERE `created` < UTC_TIMESTAMP() - INTERVAL 3 DAY"); } - if($queue_id) + if($queue_id) { $r = q("SELECT `id` FROM `queue` WHERE `id` = %d LIMIT 1", intval($queue_id) ); - else - $r = q("SELECT `id` FROM `queue` WHERE `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE "); + } + else { + // For the first 12 hours we'll try to deliver every 15 minutes + // After that, we'll only attempt delivery once per hour. + + $r = q("SELECT `id` FROM `queue` WHERE (( `created` > UTC_TIMESTAMP() - INTERVAL 12 HOUR && `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ) OR ( `last` < UTC_TIMESTAMP() - INTERVAL 1 HOUR ))"); + } if(! count($r)){ return; } |