Skip to content

Commit

Permalink
move keep alive
Browse files Browse the repository at this point in the history
  • Loading branch information
siosphere committed Nov 28, 2016
1 parent 3d26a21 commit 4f5cfe8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Virge/Graphite/Service/QueueService.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ public function listen($queue, $callback) {
};*/

$this->getChannel()->basic_consume($queue, '', false, false, false, false, function($message) use($callback) {
$this->keepAliveCallback();
$task = unserialize($message->body);
call_user_func($callback, $task);

$this->complete($message);
});
while(count($this->getChannel()->callbacks)) {
try {
$this->getChannel()->wait(null, false, Config::get('queue', 'wait_timeout'));
$this->getChannel()->wait();
} catch (\PhpAmqpLib\Exception\AMQPTimeoutException $timeout) {
}
$this->keepAliveCallback();
}
}

Expand Down

0 comments on commit 4f5cfe8

Please sign in to comment.