Stop daemons using 100% CPU and hammering the DB server when the queue is empty (DBQueueManager-based only)
This commit is contained in:
parent
38d70f1386
commit
be5f9ca0e1
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user