Skip to content

Commit 5aef7f2

Browse files
committed
fix for delay argument being DateTime
1 parent 160866c commit 5aef7f2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/FintechFab/LaravelQueueRabbitMQ/Queue/RabbitMQQueue.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use AMQPException;
77
use AMQPExchange;
88
use AMQPQueue;
9+
use DateTime;
910
use FintechFab\LaravelQueueRabbitMQ\Queue\Jobs\RabbitMQJob;
1011
use Illuminate\Queue\Queue;
1112
use Illuminate\Queue\QueueInterface;
@@ -198,15 +199,16 @@ public function declareQueue($name)
198199
}
199200

200201
/**
201-
* @param string $destination
202+
* @param string $destination
202203
*
203-
* @param int $delay
204+
* @param DateTime|int $delay
204205
*
205206
* @return AMQPQueue
206207
*/
207208
public function declareDelayedQueue($destination, $delay)
208209
{
209210
$destination = $this->getQueueName($destination);
211+
$delay = $this->getSeconds($delay);
210212
$name = $destination . '_deferred_' . $delay;
211213

212214
$queue = new AMQPQueue($this->channel);

0 commit comments

Comments
 (0)