Skip to content

Commit

Permalink
Adjust queue config
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartcusackie committed Oct 4, 2024
1 parent bc92ffa commit 65cf29f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Check the config file for special features such as queue configuration and light
```
php artisan requester:entries
```
This one basically does the same as `php please static:warm`. If you are using Static caching then **it's a good idea to add either one of these commands to your deploy script (e.g. Forge).** Deployments clear the static cache so this will rebuild it for all entries afterwards.
If you are using Static caching then **it's a good idea to add this command to your deploy script (e.g. Forge).** Deployments clear the static cache so this will rebuild it for all entries afterwards.
<br/><br/>

```
php artisan requester:images
```
This one queues up jobs to visit every entry url and scan them for image urls, which will also then be queued as jobs for visiting. This process prepares all of your images in advance, but it can take a long time to run. You will usually only run this command once on initial deployment of the site, or after any major restructuring of asset filenames and folders. I do **not** recommend adding this to your deployment script as images rarely change.
You will usually only run this command once on initial deployment of the site, or after any major restructuring of asset filenames and folders. I do **not** recommend adding this to your deployment script as images rarely change.
<br/><br/>

```
Expand All @@ -45,7 +45,7 @@ Clears the configured queue. Be careful if using the default queue or a shared q

## Queues

This package utilises a Redis queue called **cacherequester**. You can configure the package to use whatever queue and connection that you prefer but it's probably best not to use a shared queue or the default queue.
This package utilises the default queue connection and name. You can set up a separate queue name in the config.

The queue can be ran manually with this command:

Expand Down
5 changes: 2 additions & 3 deletions config/statamic-cache-requester.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
| Queue
|--------------------------------------------------------------------------
|
| Define your queue settings here. I recommend redis but any queue is fine.
| Define your queue settings here.
|
*/
'queue_connection' => 'redis',
'queue_name' => 'cacherequester',
'queue_name' => env('STATAMIC_CACHE_REQUESTER_QUEUE_NAME', 'default'),

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Commands/ClearRequestQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ClearRequestQueue extends Command
*/
public function handle()
{
$connection = config('statamic-cache-requester.queue_connection');
$connection = config('queue.default');
$queue = config('statamic-cache-requester.queue_name');

try {
Expand Down
2 changes: 1 addition & 1 deletion src/Jobs/RequestUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class RequestUrl implements ShouldQueue
*/
public function __construct(string $url, bool $processImages = false, string $requestType = 'get', array $postData = [])
{
$this->onConnection(config('statamic-cache-requester.queue_connection'));
$this->onConnection(config('queue.default'));
$this->onQueue(config('statamic-cache-requester.queue_name'));

$this->url = $this->applyUrlManipulations($url);
Expand Down

0 comments on commit 65cf29f

Please sign in to comment.