queue.php 5.0 KB

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