Pull request: use mathutil
Merge in DNS/adguard-home from use-mathutil to master Squashed commit of the following: commit cfe2c02a7bb727e81fcd91674aa777df37413a8e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Jan 24 18:12:32 2023 +0300 all: use mathutil
This commit is contained in:
@@ -66,11 +66,12 @@ func (ab *authRateLimiter) check(usrID string) (left time.Duration) {
|
||||
defer ab.failedAuthsLock.Unlock()
|
||||
|
||||
ab.cleanupLocked(now)
|
||||
|
||||
return ab.checkLocked(usrID, now)
|
||||
}
|
||||
|
||||
// incLocked increments the number of unsuccessful attempts for attempter with
|
||||
// ip and updates it's blocking moment if needed. For internal use only.
|
||||
// usrID and updates it's blocking moment if needed. For internal use only.
|
||||
func (ab *authRateLimiter) incLocked(usrID string, now time.Time) {
|
||||
until := now.Add(failedAuthTTL)
|
||||
var attNum uint = 1
|
||||
|
||||
Reference in New Issue
Block a user