File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Illuminate \Queue ;
4
4
5
+ use DateTimeInterface ;
5
6
use Illuminate \Contracts \Queue \Job as JobContract ;
7
+ use Illuminate \Support \InteractsWithTime ;
6
8
use InvalidArgumentException ;
7
9
use Throwable ;
8
10
9
11
trait InteractsWithQueue
10
12
{
13
+ use InteractsWithTime;
14
+
11
15
/**
12
16
* The underlying queue job instance.
13
17
*
@@ -61,11 +65,15 @@ public function fail($exception = null)
61
65
/**
62
66
* Release the job back into the queue after (n) seconds.
63
67
*
64
- * @param int $delay
68
+ * @param \DateTimeInterface|\DateInterval| int $delay
65
69
* @return void
66
70
*/
67
71
public function release ($ delay = 0 )
68
72
{
73
+ $ delay = $ delay instanceof DateTimeInterface
74
+ ? $ this ->secondsUntil ($ delay )
75
+ : $ delay ;
76
+
69
77
if ($ this ->job ) {
70
78
return $ this ->job ->release ($ delay );
71
79
}
You can’t perform that action at this time.
0 commit comments