Skip to content

Commit

Permalink
修改提示
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyangbest committed Jul 27, 2018
1 parent 2624713 commit 4066226
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Process/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@ public function run()
try {
if ($this->blocking) {
$data = Container::instance()->delayqueue->bpop($this->topics,$this->interval);
Container::instance()->logger->info(sprintf('blocking with timeout of %d',$this->interval));
if(empty($data)){
Container::instance()->logger->info(sprintf('blocking with timeout of %d',$this->interval));
}
} else {
$data = Container::instance()->delayqueue->pop($this->topics);
sleep($this->interval);
Container::instance()->logger->info(sprintf('sleeping with timeout of %d',$this->interval));
if(empty($data)){
sleep($this->interval);
Container::instance()->logger->info(sprintf('sleeping with timeout of %d',$this->interval));
}
}

} catch (\Exception $exception) {
Expand Down

0 comments on commit 4066226

Please sign in to comment.