fix: add periodic cleanup of login_attempts hash
Sweep stale entries every 5 minutes to prevent unbounded memory growth from IPs that touch the login endpoint once and never return.
This commit is contained in:
@@ -224,6 +224,7 @@ module Volumen
|
||||
end
|
||||
|
||||
def check_login_rate_limit!
|
||||
Volumen.sweep_login_attempts!
|
||||
ip = request.ip.to_s
|
||||
now = Time.now.to_f
|
||||
cutoff = now - LOGIN_WINDOW
|
||||
|
||||
Reference in New Issue
Block a user