]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Stop daemons using 100% CPU and hammering the DB server when the queue is empty ...
authorCiaranG <ciaran@ciarang.com>
Wed, 22 Jul 2009 08:25:27 +0000 (09:25 +0100)
committerCiaranG <ciaran@ciarang.com>
Wed, 22 Jul 2009 08:25:27 +0000 (09:25 +0100)
lib/dbqueuemanager.php

index a37a8ffdf645c2699a2bee671b4a1f45abf3104b..1df5af6c1157d72641117382d3f0705bf975bddb 100644 (file)
@@ -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;