mirror of
https://github.com/discourse/discourse.git
synced 2025-01-06 13:39:54 +08:00
c315e26485
* Split `shutdown` into two separate methods for better control: - `shutdown` - signals threads to stop accepting new work - `wait_for_termination` - waits for threads to finish (with optional timeout) * Add tracking of busy threads via `@busy_threads` Set * Make idle_time parameter optional with 30-second default * Improve thread spawning logic: - Spawn initial thread immediately when work is posted - Spawn additional threads when all threads are busy and work is queued * Fix race condition in work distribution * Add busy thread count to stats output * Add test coverage for zero min_threads configuration This commit makes the ThreadPool more reliable, easier to use, and adds better visibility into its internal state. --------- Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com> |
||
---|---|---|
.. | ||
fabricators | ||
fixtures | ||
generator | ||
helpers | ||
import_export | ||
initializers | ||
integration | ||
integrity | ||
jobs | ||
lib | ||
mailers | ||
migrations | ||
models | ||
multisite | ||
requests | ||
script/import_scripts | ||
serializers | ||
services | ||
support | ||
system | ||
tasks | ||
views | ||
rails_helper.rb | ||
regenerate_swagger_docs | ||
swagger_helper.rb |