mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
BUGFIX: incorrect OOBGC algorithm, not dynamically adjusting
This commit is contained in:
parent
bd7d1e62f6
commit
024b86e112
1 changed files with 2 additions and 2 deletions
|
@ -106,12 +106,12 @@ module Middleware::UnicornOobgc
|
|||
@max_delta ||= delta
|
||||
|
||||
if delta > @max_delta
|
||||
new_delta = (delta * 1.5).to_i
|
||||
new_delta = (@max_delta * 1.5).to_i
|
||||
@max_delta = [new_delta, delta].min
|
||||
else
|
||||
# this may seem like a very tiny decay rate, but some apps using caching
|
||||
# can really mess stuff up, if our delta is too low the algorithm fails
|
||||
new_delta = (delta * 0.995).to_i
|
||||
new_delta = (@max_delta * 0.99).to_i
|
||||
@max_delta = [new_delta, delta].max
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue