Skip to content
This repository was archived by the owner on Sep 3, 2020. It is now read-only.

Commit fc0cbc3

Browse files
xinghuoxinghuo
authored andcommitted
update bugfix delay rabbitmq support lavarel delay function
1 parent a404ea9 commit fc0cbc3

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
@@ -69,9 +69,10 @@ public function pushRaw($payload, $queue = null, array $options = [])
6969
$exchange = $this->configExchange['name'] ?:$queue;
7070
$this->declareQueue($queue);
7171
if (isset($options['delay'])) {
72-
$queue = $this->declareDelayedQueue($queue, $options['delay']);
72+
list($queue,$exchange) = $this->declareDelayedQueue($queue, $options['delay']);
73+
}else{
74+
$this->declareQueue($queue);
7375
}
74-
7576
// push job to a queue
7677
$message = new AMQPMessage($payload, [
7778
'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)