diff --git a/src/Illuminate/Queue/BeanstalkdQueue.php b/src/Illuminate/Queue/BeanstalkdQueue.php index 3f1e0a5d6a96..657a1bfe9dac 100755 --- a/src/Illuminate/Queue/BeanstalkdQueue.php +++ b/src/Illuminate/Queue/BeanstalkdQueue.php @@ -76,13 +76,17 @@ public function size($queue = null) /** * Push a new job onto the queue. * - * @param string $job + * @param object|string $job * @param mixed $data * @param string|null $queue * @return mixed */ public function push($job, $data = '', $queue = null) { + if ($job->delay ?? null) { + return $this->later($job->delay, $job, $data, $queue); + } + return $this->enqueueUsing( $job, $this->createPayload($job, $this->getQueue($queue), $data), diff --git a/src/Illuminate/Queue/DatabaseQueue.php b/src/Illuminate/Queue/DatabaseQueue.php index bce025c53340..cf47a9220ba6 100644 --- a/src/Illuminate/Queue/DatabaseQueue.php +++ b/src/Illuminate/Queue/DatabaseQueue.php @@ -80,13 +80,17 @@ public function size($queue = null) /** * Push a new job onto the queue. * - * @param string $job + * @param object|string $job * @param mixed $data * @param string|null $queue * @return mixed */ public function push($job, $data = '', $queue = null) { + if ($job->delay ?? null) { + return $this->later($job->delay, $job, $data, $queue); + } + return $this->enqueueUsing( $job, $this->createPayload($job, $this->getQueue($queue), $data), @@ -118,7 +122,7 @@ public function pushRaw($payload, $queue = null, array $options = []) * @param string $job * @param mixed $data * @param string|null $queue - * @return void + * @return mixed */ public function later($delay, $job, $data = '', $queue = null) { diff --git a/src/Illuminate/Queue/RedisQueue.php b/src/Illuminate/Queue/RedisQueue.php index 4c376a81a2c0..13972b0bf48b 100644 --- a/src/Illuminate/Queue/RedisQueue.php +++ b/src/Illuminate/Queue/RedisQueue.php @@ -131,6 +131,10 @@ public function bulk($jobs, $data = '', $queue = null) */ public function push($job, $data = '', $queue = null) { + if ($job->delay ?? null) { + return $this->later($job->delay, $job, $data, $queue); + } + return $this->enqueueUsing( $job, $this->createPayload($job, $this->getQueue($queue), $data), diff --git a/src/Illuminate/Queue/SqsQueue.php b/src/Illuminate/Queue/SqsQueue.php index d4ca1d993946..275e465fe848 100755 --- a/src/Illuminate/Queue/SqsQueue.php +++ b/src/Illuminate/Queue/SqsQueue.php @@ -82,13 +82,17 @@ public function size($queue = null) /** * Push a new job onto the queue. * - * @param string $job + * @param object|string $job * @param mixed $data * @param string|null $queue * @return mixed */ public function push($job, $data = '', $queue = null) { + if ($job->delay ?? null) { + return $this->later($job->delay, $job, $data, $queue); + } + return $this->enqueueUsing( $job, $this->createPayload($job, $queue ?: $this->default, $data),