|
1 | 1 | <?php
|
2 | 2 |
|
| 3 | +use Illuminate\Support\Str; |
| 4 | +use Laravel\Scout\Jobs\MakeSearchable; |
| 5 | + |
3 | 6 | return [
|
4 | 7 |
|
| 8 | + /* |
| 9 | + |-------------------------------------------------------------------------- |
| 10 | + | Horizon Domain |
| 11 | + |-------------------------------------------------------------------------- |
| 12 | + | |
| 13 | + | This is the subdomain where Horizon will be accessible from. If this |
| 14 | + | setting is null, Horizon will reside under the same domain as the |
| 15 | + | application. Otherwise, this value will serve as the subdomain. |
| 16 | + | |
| 17 | + */ |
| 18 | + |
| 19 | + 'domain' => env('HORIZON_DOMAIN'), |
| 20 | + |
| 21 | + /* |
| 22 | + |-------------------------------------------------------------------------- |
| 23 | + | Horizon Path |
| 24 | + |-------------------------------------------------------------------------- |
| 25 | + | |
| 26 | + | This is the URI path where Horizon will be accessible from. Feel free |
| 27 | + | to change this path to anything you like. Note that the URI will not |
| 28 | + | affect the paths of its internal API that aren't exposed to users. |
| 29 | + | |
| 30 | + */ |
| 31 | + |
| 32 | + 'path' => env('HORIZON_PATH', 'horizon'), |
| 33 | + |
5 | 34 | /*
|
6 | 35 | |--------------------------------------------------------------------------
|
7 | 36 | | Horizon Redis Connection
|
|
26 | 55 | |
|
27 | 56 | */
|
28 | 57 |
|
29 |
| - 'prefix' => env('HORIZON_PREFIX', 'horizon:'), |
| 58 | + 'prefix' => env( |
| 59 | + 'HORIZON_PREFIX', |
| 60 | + 'horizon:' |
| 61 | + // Str::slug(env('APP_NAME', 'laravel'), '_').'_horizon:' |
| 62 | + ), |
| 63 | + |
| 64 | + /* |
| 65 | + |-------------------------------------------------------------------------- |
| 66 | + | Horizon Route Middleware |
| 67 | + |-------------------------------------------------------------------------- |
| 68 | + | |
| 69 | + | These middleware will get attached onto each Horizon route, giving you |
| 70 | + | the chance to add your own middleware to this list or change any of |
| 71 | + | the existing middleware. Or, you can simply stick with this list. |
| 72 | + | |
| 73 | + */ |
| 74 | + |
| 75 | + 'middleware' => ['web'], |
30 | 76 |
|
31 | 77 | /*
|
32 | 78 | |--------------------------------------------------------------------------
|
|
56 | 102 |
|
57 | 103 | 'trim' => [
|
58 | 104 | 'recent' => 60,
|
| 105 | + 'pending' => 60, |
| 106 | + 'completed' => 60, |
| 107 | + 'recent_failed' => 10080, |
59 | 108 | 'failed' => 10080,
|
| 109 | + 'monitored' => 10080, |
60 | 110 | ],
|
61 | 111 |
|
| 112 | + /* |
| 113 | + |-------------------------------------------------------------------------- |
| 114 | + | Silenced Jobs |
| 115 | + |-------------------------------------------------------------------------- |
| 116 | + | |
| 117 | + | Silencing a job will instruct Horizon to not place the job in the list |
| 118 | + | of completed jobs within the Horizon dashboard. This setting may be |
| 119 | + | used to fully remove any noisy jobs from the completed jobs list. |
| 120 | + | |
| 121 | + */ |
| 122 | + |
| 123 | + 'silenced' => [ |
| 124 | + MakeSearchable::class, |
| 125 | + ], |
| 126 | + |
| 127 | + /* |
| 128 | + |-------------------------------------------------------------------------- |
| 129 | + | Metrics |
| 130 | + |-------------------------------------------------------------------------- |
| 131 | + | |
| 132 | + | Here you can configure how many snapshots should be kept to display in |
| 133 | + | the metrics graph. This will get used in combination with Horizon's |
| 134 | + | `horizon:snapshot` schedule to define how long to retain metrics. |
| 135 | + | |
| 136 | + */ |
| 137 | + |
| 138 | + 'metrics' => [ |
| 139 | + 'trim_snapshots' => [ |
| 140 | + 'job' => 24, |
| 141 | + 'queue' => 24, |
| 142 | + ], |
| 143 | + ], |
| 144 | + |
| 145 | + /* |
| 146 | + |-------------------------------------------------------------------------- |
| 147 | + | Fast Termination |
| 148 | + |-------------------------------------------------------------------------- |
| 149 | + | |
| 150 | + | When this option is enabled, Horizon's "terminate" command will not |
| 151 | + | wait on all of the workers to terminate unless the --wait option |
| 152 | + | is provided. Fast termination can shorten deployment delay by |
| 153 | + | allowing a new instance of Horizon to start while the last |
| 154 | + | instance will continue to terminate each of its workers. |
| 155 | + | |
| 156 | + */ |
| 157 | + |
| 158 | + 'fast_termination' => false, |
| 159 | + |
| 160 | + /* |
| 161 | + |-------------------------------------------------------------------------- |
| 162 | + | Memory Limit (MB) |
| 163 | + |-------------------------------------------------------------------------- |
| 164 | + | |
| 165 | + | This value describes the maximum amount of memory the Horizon master |
| 166 | + | supervisor may consume before it is terminated and restarted. For |
| 167 | + | configuring these limits on your workers, see the next section. |
| 168 | + | |
| 169 | + */ |
| 170 | + |
| 171 | + 'memory_limit' => 64, |
| 172 | + |
62 | 173 | /*
|
63 | 174 | |--------------------------------------------------------------------------
|
64 | 175 | | Queue Worker Configuration
|
|
70 | 181 | |
|
71 | 182 | */
|
72 | 183 |
|
| 184 | + 'defaults' => [ |
| 185 | + 'supervisor-1' => [ |
| 186 | + 'connection' => 'redis', |
| 187 | + 'queue' => ['default'], |
| 188 | + 'balance' => 'auto', |
| 189 | + 'autoScalingStrategy' => 'time', |
| 190 | + 'maxProcesses' => 1, |
| 191 | + 'maxTime' => 0, |
| 192 | + 'maxJobs' => 0, |
| 193 | + 'memory' => 128, |
| 194 | + 'tries' => 1, |
| 195 | + 'timeout' => 60, |
| 196 | + 'nice' => 0, |
| 197 | + ], |
| 198 | + ], |
| 199 | + |
73 | 200 | 'environments' => [
|
74 | 201 | 'production' => [
|
75 | 202 | 'supervisor-1' => [
|
76 |
| - 'connection' => 'redis', |
77 |
| - 'queue' => ['default'], |
78 |
| - 'balance' => 'simple', |
79 |
| - 'processes' => 10, |
80 |
| - 'tries' => 3, |
| 203 | + 'maxProcesses' => 10, |
| 204 | + 'balanceMaxShift' => 1, |
| 205 | + 'balanceCooldown' => 3, |
81 | 206 | ],
|
82 | 207 | ],
|
83 | 208 |
|
84 | 209 | 'local' => [
|
85 | 210 | 'supervisor-1' => [
|
86 |
| - 'connection' => 'redis', |
87 |
| - 'queue' => ['default'], |
88 |
| - 'balance' => 'simple', |
89 |
| - 'processes' => 3, |
90 |
| - 'tries' => 3, |
| 211 | + 'maxProcesses' => 3, |
91 | 212 | ],
|
92 | 213 | ],
|
93 | 214 | ],
|
|
0 commit comments