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
1 changed files with 3 additions and 1 deletions

View 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;