horizon.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Horizon Redis Connection
  6. |--------------------------------------------------------------------------
  7. |
  8. | This is the name of the Redis connection where Horizon will store the
  9. | meta information required for it to function. It includes the list
  10. | of supervisors, failed jobs, job metrics, and other information.
  11. |
  12. */
  13. 'use' => 'default',
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Horizon Redis Prefix
  17. |--------------------------------------------------------------------------
  18. |
  19. | This prefix will be used when storing all Horizon data in Redis. You
  20. | may modify the prefix when you are running multiple installations
  21. | of Horizon on the same server so that they don't have problems.
  22. |
  23. */
  24. 'prefix' => env('HORIZON_PREFIX', 'horizon:'),
  25. /*
  26. |--------------------------------------------------------------------------
  27. | Queue Wait Time Thresholds
  28. |--------------------------------------------------------------------------
  29. |
  30. | This option allows you to configure when the LongWaitDetected event
  31. | will be fired. Every connection / queue combination may have its
  32. | own, unique threshold (in seconds) before this event is fired.
  33. |
  34. */
  35. 'waits' => [
  36. 'redis:default' => 60,
  37. ],
  38. /*
  39. |--------------------------------------------------------------------------
  40. | Job Trimming Times
  41. |--------------------------------------------------------------------------
  42. |
  43. | Here you can configure for how long (in minutes) you desire Horizon to
  44. | persist the recent and failed jobs. Typically, recent jobs are kept
  45. | for one hour while all failed jobs are stored for an entire week.
  46. |
  47. */
  48. 'trim' => [
  49. 'recent' => 60,
  50. 'failed' => 10080,
  51. ],
  52. /*
  53. |--------------------------------------------------------------------------
  54. | Fast Termination
  55. |--------------------------------------------------------------------------
  56. |
  57. | When this option is enabled, Horizon's "terminate" command will not
  58. | wait on all of the workers to terminate unless the --wait option
  59. | is provided. Fast termination can shorten deployment delay by
  60. | allowing a new instance of Horizon to start while the last
  61. | instance will continue to terminate each of its workers.
  62. |
  63. */
  64. 'fast_termination' => false,
  65. /*
  66. |--------------------------------------------------------------------------
  67. | Queue Worker Configuration
  68. |--------------------------------------------------------------------------
  69. |
  70. | Here you may define the queue worker settings used by your application
  71. | in all environments. These supervisors and settings handle all your
  72. | queued jobs and will be provisioned by Horizon during deployment.
  73. |
  74. */
  75. 'environments' => [
  76. 'production' => [
  77. 'supervisor-1' => [
  78. 'connection' => 'redis',
  79. 'queue' => ['default'],
  80. 'balance' => 'simple',
  81. 'processes' => 10,
  82. 'tries' => 3,
  83. ],
  84. ],
  85. 'local' => [
  86. 'supervisor-1' => [
  87. 'connection' => 'redis',
  88. 'queue' => ['default'],
  89. 'balance' => 'simple',
  90. 'processes' => 3,
  91. 'tries' => 3,
  92. ],
  93. ],
  94. ],
  95. ];