horizon.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. env('APP_NAME', 'jsaix').'-supervisor-1' => [
  78. 'connection' => 'redis',
  79. 'queue' => ['default', 'email', 'pay', 'search'],
  80. 'balance' => 'auto',
  81. 'processes' => 8,
  82. 'tries' => 3,
  83. ],
  84. env('APP_NAME', 'jsaix').'-supervisor-2' => [
  85. 'connection' => 'redis',
  86. 'queue' => ['sms'],
  87. 'balance' => 'simple',
  88. 'processes' => 1,
  89. 'tries' => 1,
  90. ],
  91. env('APP_NAME', 'jsaix').'-supervisor-3' => [
  92. 'connection' => 'redis',
  93. 'queue' => ['sys_message'],
  94. 'balance' => 'simple',
  95. 'processes' => 1,
  96. 'tries' => 1,
  97. ],
  98. 'jucai-supervisor-1' => [
  99. 'connection' => 'redis',
  100. 'queue' => ['ticket'],
  101. 'balance' => 'auto',
  102. 'processes' => 10,
  103. 'tries' => 3,
  104. ],
  105. ],
  106. 'local' => [
  107. env('APP_NAME', 'jsaix').'-supervisor-1' => [
  108. 'connection' => 'redis',
  109. 'queue' => ['default', 'email', 'pay', 'search'],
  110. 'balance' => 'auto',
  111. 'processes' => 8,
  112. 'tries' => 3,
  113. ],
  114. env('APP_NAME', 'jsaix').'-supervisor-2' => [
  115. 'connection' => 'redis',
  116. 'queue' => ['sms'],
  117. 'balance' => 'simple',
  118. 'processes' => 1,
  119. 'tries' => 1,
  120. ],
  121. env('APP_NAME', 'jsaix').'-supervisor-3' => [
  122. 'connection' => 'redis',
  123. 'queue' => ['sys_message'],
  124. 'balance' => 'simple',
  125. 'processes' => 1,
  126. 'tries' => 1,
  127. ],
  128. env('APP_NAME', 'jsaix').'-supervisor-4' => [
  129. 'connection' => 'redis',
  130. 'queue' => ['ticket'],
  131. 'balance' => 'auto',
  132. 'processes' => 10,
  133. 'tries' => 1,
  134. ],
  135. ],
  136. ],
  137. ];