diff --git a/src/Illuminate/Queue/InteractsWithQueue.php b/src/Illuminate/Queue/InteractsWithQueue.php index 36a86aeacf33..9193b878f470 100644 --- a/src/Illuminate/Queue/InteractsWithQueue.php +++ b/src/Illuminate/Queue/InteractsWithQueue.php @@ -2,12 +2,16 @@ namespace Illuminate\Queue; +use DateTimeInterface; use Illuminate\Contracts\Queue\Job as JobContract; +use Illuminate\Support\InteractsWithTime; use InvalidArgumentException; use Throwable; trait InteractsWithQueue { + use InteractsWithTime; + /** * The underlying queue job instance. * @@ -61,11 +65,15 @@ public function fail($exception = null) /** * Release the job back into the queue after (n) seconds. * - * @param int $delay + * @param \DateTimeInterface|\DateInterval|int $delay * @return void */ public function release($delay = 0) { + $delay = $delay instanceof DateTimeInterface + ? $this->secondsUntil($delay) + : $delay; + if ($this->job) { return $this->job->release($delay); }