summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/queuehandler.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/queuehandler.php b/lib/queuehandler.php
index ba7a93ab2..3115ea38d 100644
--- a/lib/queuehandler.php
+++ b/lib/queuehandler.php
@@ -81,21 +81,18 @@ class QueueHandler {
$this->log(LOG_WARNING, 'queue item for notice that does not exist');
}
$qi->delete();
- $this->idle();
+ $this->idle(0);
} else {
$this->clear_old_claims();
- $start = microtime();
- $this->idle();
- $used = microtime() - $start;
- if ($used < 1000000) {
- usleep(1000000 - $used);
- }
+ $this->idle(5);
}
} while (true);
}
- function idle() {
- return true;
+ function idle($timeout=0) {
+ if ($timeout>0) {
+ sleep($timeout);
+ }
}
function clear_old_claims() {