Skip to content

Commit c99bc91

Browse files
committed
Merge 'razonyang/master' into old-pulls
Closes chrisboulton/php-resque#370
2 parents 6ff26b9 + 84439b4 commit c99bc91

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Resque/Worker.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ public function reserve($blocking = false, $timeout = null)
329329
}
330330

331331
if($blocking === true) {
332+
if(empty($queues)){
333+
$this->logger->log(Psr\Log\LogLevel::INFO, 'No queue was found, sleeping for {interval}', array('interval' => $timeout));
334+
usleep($timeout * 1000000);
335+
return false;
336+
}
332337
$job = Resque_Job::reserveBlocking($queues, $timeout);
333338
if($job) {
334339
$this->logger->log(Psr\Log\LogLevel::INFO, 'Found job on {queue}', array('queue' => $job->queue));

0 commit comments

Comments
 (0)