queue.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Default Queue Connection Name
  6. |--------------------------------------------------------------------------
  7. |
  8. | Laravel's queue supports a variety of backends via a single, unified
  9. | API, giving you convenient access to each backend using identical
  10. | syntax for each. The default queue connection is defined below.
  11. |
  12. */
  13. 'default' => env('QUEUE_CONNECTION', 'database'),
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Workload Queue Names
  17. |--------------------------------------------------------------------------
  18. |
  19. | Production currently has only two consumed queues:
  20. | - default: one worker on the main server for non-PDF background work.
  21. | - pdf: nine workers across main/pdf-1/pdf-2 for PDFs and heavy analysis.
  22. |
  23. | Keep report-critical work on "pdf"; move only non-critical follow-up work
  24. | away from the PDF worker fleet.
  25. |
  26. */
  27. 'workloads' => [
  28. 'pdf' => env('QUEUE_PDF', 'pdf'),
  29. // Keep answer analysis on the scaled pdf worker fleet. Do not point
  30. // this at default unless default workers are scaled out.
  31. 'exam_answer_analysis' => env('QUEUE_EXAM_ANSWER_ANALYSIS', 'pdf'),
  32. // This follow-up is not on the visible report-generation path.
  33. 'question_difficulty_calibration' => env('QUEUE_QUESTION_DIFFICULTY_CALIBRATION', 'default'),
  34. 'question_difficulty_calibration_delay_seconds' => (int) env('QUEUE_QUESTION_DIFFICULTY_CALIBRATION_DELAY_SECONDS', 30),
  35. ],
  36. /*
  37. |--------------------------------------------------------------------------
  38. | Queue Connections
  39. |--------------------------------------------------------------------------
  40. |
  41. | Here you may configure the connection options for every queue backend
  42. | used by your application. An example configuration is provided for
  43. | each backend supported by Laravel. You're also free to add more.
  44. |
  45. | Drivers: "sync", "database", "beanstalkd", "sqs", "redis",
  46. | "deferred", "background", "failover", "null"
  47. |
  48. */
  49. 'connections' => [
  50. 'sync' => [
  51. 'driver' => 'sync',
  52. ],
  53. 'database' => [
  54. 'driver' => 'database',
  55. 'connection' => env('DB_QUEUE_CONNECTION'),
  56. 'table' => env('DB_QUEUE_TABLE', 'jobs'),
  57. 'queue' => env('DB_QUEUE', 'default'),
  58. 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
  59. 'after_commit' => false,
  60. ],
  61. 'beanstalkd' => [
  62. 'driver' => 'beanstalkd',
  63. 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
  64. 'queue' => env('BEANSTALKD_QUEUE', 'default'),
  65. 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
  66. 'block_for' => 0,
  67. 'after_commit' => false,
  68. ],
  69. 'sqs' => [
  70. 'driver' => 'sqs',
  71. 'key' => env('AWS_ACCESS_KEY_ID'),
  72. 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  73. 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
  74. 'queue' => env('SQS_QUEUE', 'default'),
  75. 'suffix' => env('SQS_SUFFIX'),
  76. 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
  77. 'after_commit' => false,
  78. ],
  79. 'redis' => [
  80. 'driver' => 'redis',
  81. 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
  82. 'queue' => env('REDIS_QUEUE', 'default'),
  83. 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
  84. 'block_for' => null,
  85. 'after_commit' => false,
  86. ],
  87. 'deferred' => [
  88. 'driver' => 'deferred',
  89. ],
  90. 'background' => [
  91. 'driver' => 'background',
  92. ],
  93. 'failover' => [
  94. 'driver' => 'failover',
  95. 'connections' => [
  96. 'database',
  97. 'deferred',
  98. ],
  99. ],
  100. ],
  101. /*
  102. |--------------------------------------------------------------------------
  103. | Job Batching
  104. |--------------------------------------------------------------------------
  105. |
  106. | The following options configure the database and table that store job
  107. | batching information. These options can be updated to any database
  108. | connection and table which has been defined by your application.
  109. |
  110. */
  111. 'batching' => [
  112. 'database' => env('DB_CONNECTION', 'sqlite'),
  113. 'table' => 'job_batches',
  114. ],
  115. /*
  116. |--------------------------------------------------------------------------
  117. | Failed Queue Jobs
  118. |--------------------------------------------------------------------------
  119. |
  120. | These options configure the behavior of failed queue job logging so you
  121. | can control how and where failed jobs are stored. Laravel ships with
  122. | support for storing failed jobs in a simple file or in a database.
  123. |
  124. | Supported drivers: "database-uuids", "dynamodb", "file", "null"
  125. |
  126. */
  127. 'failed' => [
  128. 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
  129. 'database' => env('DB_CONNECTION', 'sqlite'),
  130. 'table' => 'failed_jobs',
  131. ],
  132. ];