5
5
use Dusterio \AwsWorker \Exceptions \FailedJobException ;
6
6
use Dusterio \AwsWorker \Exceptions \MalformedRequestException ;
7
7
use Dusterio \AwsWorker \Jobs \AwsJob ;
8
+ use Dusterio \AwsWorker \Wrappers \WorkerInterface ;
8
9
use Illuminate \Contracts \Container \Container ;
9
10
use Illuminate \Http \Request ;
10
11
use Illuminate \Queue \Worker ;
@@ -57,12 +58,12 @@ public function schedule(Container $laravel, Kernel $kernel, Schedule $schedule)
57
58
58
59
/**
59
60
* @param Request $request
60
- * @param Worker $worker
61
+ * @param WorkerInterface $worker
61
62
* @param Container $laravel
62
- * @return array
63
+ * @return Response
63
64
* @throws FailedJobException
64
65
*/
65
- public function queue (Request $ request , Worker $ worker , Container $ laravel )
66
+ public function queue (Request $ request , WorkerInterface $ worker , Container $ laravel )
66
67
{
67
68
$ this ->validateHeaders ($ request );
68
69
$ body = $ this ->validateBody ($ request , $ laravel );
@@ -78,7 +79,10 @@ public function queue(Request $request, Worker $worker, Container $laravel)
78
79
79
80
try {
80
81
$ worker ->process (
81
- $ request ->header ('X-Aws-Sqsd-Queue ' ), $ job , 0 , 0
82
+ $ request ->header ('X-Aws-Sqsd-Queue ' ), $ job , [
83
+ 'maxTries ' => 0 ,
84
+ 'delay ' => 0
85
+ ]
82
86
);
83
87
} catch (\Exception $ e ) {
84
88
throw new FailedJobException ('Worker failed executing the job ' , 0 , $ e );
0 commit comments