chore(config): configure laravel queues

- use redis as the default queue connection
- use the redis "jobs" connection for all queued jobs
- set after_commit=true to ensure jobs wait for all DB transactions to finish before being dispatched
- use pgsql database for job batches
- remove logging of failed jobs into a DB table as we use horizon for that
This commit is contained in:
peaklabs-dev 2025-12-04 21:41:23 +01:00
parent e800bc97bc
commit d2cae69d99
No known key found for this signature in database

View file

@ -14,7 +14,7 @@ return [
|
*/
'default' => env('QUEUE_CONNECTION', 'database'),
'default' => env('QUEUE_CONNECTION', 'redis'),
/*
|--------------------------------------------------------------------------
@ -37,11 +37,11 @@ return [
'redis' => [
'driver' => 'redis',
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
'connection' => env('REDIS_QUEUE_CONNECTION', 'jobs'),
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
'block_for' => null,
'after_commit' => false,
'after_commit' => true,
],
],
@ -57,7 +57,7 @@ return [
*/
'batching' => [
'database' => env('DB_CONNECTION', 'sqlite'),
'database' => env('DB_CONNECTION', 'pgsql'),
'table' => 'job_batches',
],
@ -75,8 +75,6 @@ return [
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'sqlite'),
'table' => 'failed_jobs',
'driver' => env('QUEUE_FAILED_DRIVER', 'null'),
],
];