diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-07-23 14:46:54 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-07-23 14:46:54 -0700 |
commit | 8641cb4591d2b8385a661ea743833392ef45ff8b (patch) | |
tree | 8e032e94d0baa8daf5b6cbd4fe54ef0406c5f691 /lib/dbqueuemanager.php | |
parent | a7ad37f83fcdf611f9a65d38b35ac1874979198c (diff) | |
parent | 0dab5f58723cba8b5915c694a8200e242cc9ec02 (diff) |
Merge branch '0.8.x' into 0.9.x
Diffstat (limited to 'lib/dbqueuemanager.php')
-rw-r--r-- | lib/dbqueuemanager.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/dbqueuemanager.php b/lib/dbqueuemanager.php index 6e7172de0..1df5af6c1 100644 --- a/lib/dbqueuemanager.php +++ b/lib/dbqueuemanager.php @@ -55,7 +55,8 @@ class DBQueueManager extends QueueManager { while (true) { $this->_log(LOG_DEBUG, 'Checking for notices...'); - $notice = $this->_nextItem($queue, null); + $timeout = $handler->timeout(); + $notice = $this->_nextItem($queue, $timeout); if (empty($notice)) { $this->_log(LOG_DEBUG, 'No notices waiting; idling.'); // Nothing in the queue. Do you @@ -87,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; |