1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Use delete_if to remove dead workers.

```
allocated memory by file
-----------------------------------
544  /Users/frodsan/Code/frodsan/puma/lib/puma/thread_pool.rb (Before)
 40  /Users/frodsan/Code/frodsan/puma/lib/puma/thread_pool.rb (After)

retained memory by location
-----------------------------------
504  /Users/frodsan/Code/frodsan/puma/lib/puma/thread_pool.rb:184 (Before)
  0  /Users/frodsan/Code/frodsan/puma/lib/puma/thread_pool.rb:184 (After)
```
This commit is contained in:
Francesco Rodriguez 2016-09-08 19:01:49 +02:00
parent 342cbd1923
commit 0bfd58decd

View file

@ -181,7 +181,9 @@ module Puma
@spawned -= 1 @spawned -= 1
end end
@workers -= dead_workers @workers.delete_if do |w|
dead_workers.include?(w)
end
end end
end end