enforce a minimum drain rate

This commit is contained in:
Brian Gough 2019-08-13 16:15:30 +01:00
parent 00cca29d9e
commit b3e5709b64

View file

@ -4,7 +4,7 @@ module.exports = DrainManager =
startDrainTimeWindow: (io, minsToDrain)->
drainPerMin = io.sockets.clients().length / minsToDrain
DrainManager.startDrain(io, drainPerMin / 60)
DrainManager.startDrain(io, Math.max(drainPerMin / 60, 4)) # enforce minimum drain rate
startDrain: (io, rate) ->
# Clear out any old interval