laravel-workkit/config/workkit.php

69 lines
3.2 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
return [
/*
|--------------------------------------------------------------------------
| Backup Settings
|--------------------------------------------------------------------------
|
| Used by workkit:db:backup, workkit:db:restore, workkit:db:verify and
| workkit:db:prune-backups. The default `path` is storage_path('backups')
| so backups live alongside the rest of the app's storage. `retention_days`
| is the threshold workkit:db:prune-backups uses by default — anything
| older than that gets deleted on the next prune run, EXCEPT the
| `retention_min_keep` newest, which are kept regardless of age so prune
| can never leave you with zero recovery points.
|
| NOTE: every command reads these nested keys with an explicit code-side
| default (e.g. config('workkit.backup.retention_min_keep', 5)) because
| mergeConfigFrom does not deep-merge nested arrays — a consumer who
| published an older config without a new key still gets a sane value.
|
*/
'backup' => [
'path' => env('WORKKIT_BACKUP_PATH'), // null → storage_path('backups')
'retention_days' => (int) env('WORKKIT_BACKUP_RETENTION_DAYS', 30),
// Always keep at least this many newest backups regardless of age.
// 0 disables the floor (prune may then leave zero backups).
'retention_min_keep' => (int) env('WORKKIT_BACKUP_RETENTION_MIN_KEEP', 5),
// xz compression level. Lower = faster + larger output. 3 is a
// good default for SQL dumps (~10× ratio at ~3× the speed of -9).
'xz_level' => (int) env('WORKKIT_BACKUP_XZ_LEVEL', 3),
],
/*
|--------------------------------------------------------------------------
| Stats overview (workkit:stats)
|--------------------------------------------------------------------------
|
| `models` is an explicit list of Eloquent model FQCNs to count. When null
| the command auto-discovers models by scanning `models_path` (default:
| app_path('Models')). Set an explicit list to avoid scanning, or to count
| models that live outside app/Models.
|
*/
'stats' => [
'models' => null, // e.g. [\App\Models\User::class, \App\Models\Order::class]
'models_path' => null, // null → app_path('Models')
],
/*
|--------------------------------------------------------------------------
| Queue health thresholds (workkit:queue:health)
|--------------------------------------------------------------------------
|
| The command exits non-zero when any of these is breached. `max_depth`
| applies per queue; `max_depth_per_queue` overrides it for named queues
| (e.g. an intentionally-slow, rate-limited queue allowed a deeper backlog).
| A queue is flagged STALLED when its oldest *due* job is older than
| `max_age_minutes` while nothing is reserved (worker likely down).
|
*/
'queue' => [
'max_depth' => (int) env('WORKKIT_QUEUE_MAX_DEPTH', 250),
'max_depth_per_queue' => [], // e.g. ['geoip' => 5000]
'max_age_minutes' => (int) env('WORKKIT_QUEUE_MAX_AGE_MINUTES', 15),
'max_failed' => (int) env('WORKKIT_QUEUE_MAX_FAILED', 25),
],
];