Skip to content

A self-hosted media server and file management system

chore: automate horizon snapshot if using redis queues

aminnausin97c5a6a8961b
diff --git a/config/queue.php b/config/queue.php
index 0b686246..8f5a671a 100755
--- a/config/queue.php
+++ b/config/queue.php
@@ -77,7 +77,7 @@ return [
'driver' => 'redis',
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
'queue' => env('REDIS_QUEUE', 'default'),
- 'retry_after' => 172800, // Rely on Horizon to decide retries instead of Laravel -> Original: (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
+ 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 172800), // Rely on Horizon to decide retries instead of Laravel with a high default value
'block_for' => null,
'after_commit' => false,
],
diff --git a/routes/console.php b/routes/console.php
index 8b45c36d..128be79e 100755
--- a/routes/console.php
+++ b/routes/console.php
@@ -10,3 +10,7 @@ Schedule::command('sanctum:prune-expired --hours=2')->daily();
if (app()->environment('demo')) {
Schedule::command('demo:reset')->everyFifteenMinutes()->withoutOverlapping();
}
+
+if (config('queue.default') === 'redis') {
+ Schedule::command('horizon:snapshot')->everyFiveMinutes();
+}