5
5
use Barryvdh \Queue \AsyncQueue ;
6
6
use Illuminate \Console \Command ;
7
7
use Illuminate \Queue \Worker ;
8
+ use Illuminate \Queue \WorkerOptions ;
8
9
use Symfony \Component \Console \Input \InputArgument ;
9
10
use Symfony \Component \Console \Input \InputOption ;
10
11
@@ -47,13 +48,13 @@ public function __construct(Worker $worker)
47
48
*
48
49
* @return void
49
50
*/
50
- public function fire ()
51
+ public function fire (WorkerOptions $ options )
51
52
{
52
53
$ id = $ this ->argument ('id ' );
53
54
$ connection = $ this ->argument ('connection ' );
54
55
55
56
$ this ->processJob (
56
- $ connection , $ id
57
+ $ connection , $ id, $ options
57
58
);
58
59
}
59
60
@@ -62,7 +63,7 @@ public function fire()
62
63
* Process the job
63
64
*
64
65
*/
65
- protected function processJob ($ connectionName , $ id )
66
+ protected function processJob ($ connectionName , $ id, $ options )
66
67
{
67
68
$ manager = $ this ->worker ->getManager ();
68
69
$ connection = $ manager ->connection ($ connectionName );
@@ -77,7 +78,7 @@ protected function processJob($connectionName, $id)
77
78
$ sleep = max ($ job ->getDatabaseJob ()->available_at - time (), 0 );
78
79
sleep ($ sleep );
79
80
return $ this ->worker ->process (
80
- $ manager ->getName ($ connectionName ), $ job
81
+ $ manager ->getName ($ connectionName ), $ job, $ options
81
82
);
82
83
}
83
84
0 commit comments