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:
Sam
2017-12-04 18:17:18 +11:00
parent af061efcf5
commit a9bcdd7f27
7 changed files with 185 additions and 82 deletions

View File

@ -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