summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCiaranG <ciaran@ciarang.com>2009-07-22 09:25:27 +0100
committerCiaranG <ciaran@ciarang.com>2009-07-22 09:25:27 +0100
commitbe5f9ca0e1e4d3a2d1a06c39aa24874821b91cd1 (patch)
tree401e17e1cbf3e7f9b1e5623f1277d7654370e8cf
parent38d70f13865b197e17773ba24d67ea1148c32ab3 (diff)
Stop daemons using 100% CPU and hammering the DB server when the queue is empty (DBQueueManager-based only)
-rw-r--r--lib/dbqueuemanager.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/dbqueuemanager.php b/lib/dbqueuemanager.php
index a37a8ffdf..1df5af6c1 100644
--- a/lib/dbqueuemanager.php
+++ b/lib/dbqueuemanager.php
@@ -88,7 +88,9 @@ class DBQueueManager extends QueueManager
do {
$qi = Queue_item::top($queue);
- if (!empty($qi)) {
+ if (empty($qi)) {
+ sleep(1);
+ } else {
$notice = Notice::staticGet('id', $qi->notice_id);
if (!empty($notice)) {
$result = $notice;