Skip to content

Commit 67e893d

Browse files
authored
Merge pull request #107 from altin7m/master
Fix: Add Laravel 12 Support
2 parents 0326978 + 7bc5cd5 commit 67e893d

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/Integrations/BindsWorker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ trait BindsWorker
2222
protected $workerImplementations = [
2323
'5\.[345678]\.\d+' => Laravel53Worker::class,
2424
'[67]\.\d+\.\d+' => Laravel6Worker::class,
25-
'([89]|10|11)\.\d+\.\d+' => Laravel8Worker::class
25+
'([89]|10|11|12)\.\d+\.\d+' => Laravel8Worker::class
2626
];
2727

2828
/**

src/Wrappers/DefaultWorker.php

+18-2
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,33 @@
33
namespace Dusterio\AwsWorker\Wrappers;
44

55
use Illuminate\Queue\Worker;
6+
use Illuminate\Queue\WorkerOptions;
7+
use Illuminate\Contracts\Cache\Repository as Cache;
68

79
/**
810
* Class DefaultWorker
911
* @package Dusterio\AwsWorker\Wrappers
1012
*/
1113
class DefaultWorker implements WorkerInterface
1214
{
15+
/**
16+
* @var Worker
17+
*/
18+
public $worker;
19+
20+
/**
21+
* @var Cache
22+
*/
23+
public $cache;
24+
1325
/**
1426
* DefaultWorker constructor.
1527
* @param Worker $worker
28+
* @param \Illuminate\Contracts\Cache\Repository $cache
1629
*/
17-
public function __construct(Worker $worker)
30+
public function __construct(Worker $worker, Cache $cache)
1831
{
32+
$this->cache = $cache;
1933
$this->worker = $worker;
2034
}
2135

@@ -27,8 +41,10 @@ public function __construct(Worker $worker)
2741
*/
2842
public function process($queue, $job, array $options)
2943
{
44+
$workerOptions = new WorkerOptions('default', $options['delay'], 128, $options['timeout'], 3, $options['maxTries']);
45+
3046
$this->worker->process(
31-
$queue, $job, $options['maxTries'], $options['delay']
47+
$queue, $job, $workerOptions
3248
);
3349
}
3450
}

0 commit comments

Comments
 (0)