mirror of https://github.com/rails/rails
Merge pull request #52468 from heka1024/available-processor-count-in-async-adapter
Use `RAILS_MAX_THREADS` in `ActiveJob::AsyncAdapter`
This commit is contained in:
commit
a0a894cecb
|
@ -1,2 +1,5 @@
|
|||
* Use `RAILS_MAX_THREADS` in `ActiveJob::AsyncAdapter`. If it is not set, use 5 as default.
|
||||
|
||||
*heka1024*
|
||||
|
||||
Please check [7-2-stable](https://github.com/rails/rails/blob/7-2-stable/activejob/CHANGELOG.md) for previous changes.
|
||||
|
|
|
@ -74,7 +74,7 @@ module ActiveJob
|
|||
class Scheduler # :nodoc:
|
||||
DEFAULT_EXECUTOR_OPTIONS = {
|
||||
min_threads: 0,
|
||||
max_threads: Concurrent.processor_count,
|
||||
max_threads: ENV.fetch("RAILS_MAX_THREADS", 5).to_i,
|
||||
auto_terminate: true,
|
||||
idletime: 60, # 1 minute
|
||||
max_queue: 0, # unlimited
|
||||
|
|
Loading…
Reference in New Issue