queue.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. | Keep browser-visible PDF generation isolated from CPU/DB side work. The
  20. | defaults match docker-compose.yml: math_cms_queue consumes "default",
  21. | while math_cms_pdf consumes "pdf".
  22. |
  23. */
  24. 'workloads' => [
  25. 'pdf' => env('QUEUE_PDF', 'pdf'),
  26. 'exam_answer_analysis' => env('QUEUE_EXAM_ANSWER_ANALYSIS', 'default'),
  27. 'question_difficulty_calibration' => env('QUEUE_QUESTION_DIFFICULTY_CALIBRATION', 'default'),
  28. 'question_difficulty_calibration_delay_seconds' => (int) env('QUEUE_QUESTION_DIFFICULTY_CALIBRATION_DELAY_SECONDS', 30),
  29. ],
  30. /*
  31. |--------------------------------------------------------------------------
  32. | Queue Connections
  33. |--------------------------------------------------------------------------
  34. |
  35. | Here you may configure the connection options for every queue backend
  36. | used by your application. An example configuration is provided for
  37. | each backend supported by Laravel. You're also free to add more.
  38. |
  39. | Drivers: "sync", "database", "beanstalkd", "sqs", "redis",
  40. | "deferred", "background", "failover", "null"
  41. |
  42. */
  43. 'connections' => [
  44. 'sync' => [
  45. 'driver' => 'sync',
  46. ],
  47. 'database' => [
  48. 'driver' => 'database',
  49. 'connection' => env('DB_QUEUE_CONNECTION'),
  50. 'table' => env('DB_QUEUE_TABLE', 'jobs'),
  51. 'queue' => env('DB_QUEUE', 'default'),
  52. 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
  53. 'after_commit' => false,
  54. ],
  55. 'beanstalkd' => [
  56. 'driver' => 'beanstalkd',
  57. 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
  58. 'queue' => env('BEANSTALKD_QUEUE', 'default'),
  59. 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
  60. 'block_for' => 0,
  61. 'after_commit' => false,
  62. ],
  63. 'sqs' => [
  64. 'driver' => 'sqs',
  65. 'key' => env('AWS_ACCESS_KEY_ID'),
  66. 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  67. 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
  68. 'queue' => env('SQS_QUEUE', 'default'),
  69. 'suffix' => env('SQS_SUFFIX'),
  70. 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
  71. 'after_commit' => false,
  72. ],
  73. 'redis' => [
  74. 'driver' => 'redis',
  75. 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
  76. 'queue' => env('REDIS_QUEUE', 'default'),
  77. 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
  78. 'block_for' => null,
  79. 'after_commit' => false,
  80. ],
  81. 'deferred' => [
  82. 'driver' => 'deferred',
  83. ],
  84. 'background' => [
  85. 'driver' => 'background',
  86. ],
  87. 'failover' => [
  88. 'driver' => 'failover',
  89. 'connections' => [
  90. 'database',
  91. 'deferred',
  92. ],
  93. ],
  94. ],
  95. /*
  96. |--------------------------------------------------------------------------
  97. | Job Batching
  98. |--------------------------------------------------------------------------
  99. |
  100. | The following options configure the database and table that store job
  101. | batching information. These options can be updated to any database
  102. | connection and table which has been defined by your application.
  103. |
  104. */
  105. 'batching' => [
  106. 'database' => env('DB_CONNECTION', 'sqlite'),
  107. 'table' => 'job_batches',
  108. ],
  109. /*
  110. |--------------------------------------------------------------------------
  111. | Failed Queue Jobs
  112. |--------------------------------------------------------------------------
  113. |
  114. | These options configure the behavior of failed queue job logging so you
  115. | can control how and where failed jobs are stored. Laravel ships with
  116. | support for storing failed jobs in a simple file or in a database.
  117. |
  118. | Supported drivers: "database-uuids", "dynamodb", "file", "null"
  119. |
  120. */
  121. 'failed' => [
  122. 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
  123. 'database' => env('DB_CONNECTION', 'sqlite'),
  124. 'table' => 'failed_jobs',
  125. ],
  126. ];