Skip to content

Commit aca06dc

Browse files
committed
Merge pull request vyuldashev#56 from liuchenrang/master
update bugfix delay rabbitmq support lavarel delay function
2 parents ec2a55e + fc0cbc3 commit aca06dc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/VladimirYuldashev/LaravelQueueRabbitMQ/Queue/RabbitMQQueue.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ public function pushRaw($payload, $queue = null, array $options = [])
6868
$queue = $this->getQueueName($queue);
6969
$this->declareQueue($queue);
7070
if (isset($options['delay'])) {
71-
$queue = $this->declareDelayedQueue($queue, $options['delay']);
71+
list($queue,$exchange) = $this->declareDelayedQueue($queue, $options['delay']);
72+
}else{
73+
$this->declareQueue($queue);
7274
}
73-
7475
// push job to a queue
7576
$message = new AMQPMessage($payload, [
7677
'Content-Type' => 'application/json',
@@ -215,7 +216,7 @@ private function declareDelayedQueue($destination, $delay)
215216
// bind queue to the exchange
216217
$this->channel->queue_bind($name, $exchange, $name);
217218

218-
return $name;
219+
return [$name,$exchange];
219220
}
220221

221222
}

0 commit comments

Comments
 (0)