mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
PERF: improve speed of rate limiter
Also - adds a global rate limiter option - cleans up usage in tests - fixes freeze_time so it handles clock_gettime
This commit is contained in:
parent
af061efcf5
commit
a9bcdd7f27
7 changed files with 185 additions and 82 deletions
|
@ -756,7 +756,7 @@ describe SessionController do
|
|||
context 'rate limited' do
|
||||
it 'rate limits login' do
|
||||
SiteSetting.max_logins_per_ip_per_hour = 2
|
||||
RateLimiter.stubs(:disabled?).returns(false)
|
||||
RateLimiter.enable
|
||||
RateLimiter.clear_all!
|
||||
|
||||
2.times do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue