Stop daemons using 100% CPU and hammering the DB server when the queue is empty (DBQueueManager-based only)

This commit is contained in:
CiaranG 2009-07-22 09:25:27 +01:00
parent 38d70f1386
commit be5f9ca0e1

View File

@ -88,7 +88,9 @@ class DBQueueManager extends QueueManager
do { do {
$qi = Queue_item::top($queue); $qi = Queue_item::top($queue);
if (!empty($qi)) { if (empty($qi)) {
sleep(1);
} else {
$notice = Notice::staticGet('id', $qi->notice_id); $notice = Notice::staticGet('id', $qi->notice_id);
if (!empty($notice)) { if (!empty($notice)) {
$result = $notice; $result = $notice;