Skip to content

Commit 91f82b5

Browse files
Restore queue connection config
1 parent 7a1372a commit 91f82b5

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Clears the configured queue. Be careful if using the default queue or a shared q
4646

4747
## Queues
4848

49-
This package utilises a 'cacherequester' queue on the default connection. You can update the queue name using the STATAMIC_CACHE_REQUESTER_QUEUE_NAME env variable.
49+
This package utilises a 'cacherequester' queue on the default connection. You can update the queue connection and name using the STATAMIC_CACHE_REQUESTER_QUEUE_CONNECTION and STATAMIC_CACHE_REQUESTER_QUEUE_NAME env variables.
5050

5151
## Todo
5252

config/statamic-cache-requester.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
| Define your queue settings here.
2222
|
2323
*/
24-
'queue_name' => env('STATAMIC_CACHE_REQUESTER_QUEUE_NAME', 'cacherequester'),
24+
'queue' => [
25+
'connection' => env('STATAMIC_CACHE_REQUESTER_QUEUE_CONNECTION', 'default'),
26+
'name' => env('STATAMIC_CACHE_REQUESTER_QUEUE_NAME', 'cacherequester')
27+
],
2528

2629
/*
2730
|--------------------------------------------------------------------------

src/Console/Commands/ClearRequestQueue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class ClearRequestQueue extends Command
2828
*/
2929
public function handle()
3030
{
31-
$connection = config('queue.default');
32-
$queue = config('statamic-cache-requester.queue_name');
31+
$connection = config('statamic-cache-requester.queue.connection');
32+
$queue = config('statamic-cache-requester.queue.name');
3333

3434
try {
3535
Artisan::call("queue:clear {$connection} --queue={$queue} --force");

src/Jobs/RequestUrl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ class RequestUrl implements ShouldQueue
5757
*/
5858
public function __construct(string $url, bool $processImages = false, string $requestType = 'get', array $postData = [])
5959
{
60-
$this->onConnection(config('queue.default'));
61-
$this->onQueue(config('statamic-cache-requester.queue_name'));
60+
$this->onConnection(config('statamic-cache-requester.queue.connection'));
61+
$this->onQueue(config('statamic-cache-requester.queue.name'));
6262

6363
$this->url = $this->applyUrlManipulations($url);
6464
$this->processImages = $processImages;

0 commit comments

Comments
 (0)