Removed excessive variable n, and multiplying by time.Second.

This commit is contained in:
Alexander Andreev 2022-06-26 20:36:36 +04:00
parent 0c1972461e
commit be4050d1f5
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F
1 changed files with 1 additions and 2 deletions

View File

@ -36,8 +36,7 @@ func (cdb *CaptchaDB) SetExpiration(expire time.Duration) {
go func() {
for {
n := time.Now().Second()
sleepFor := expiredScanInterval - (time.Duration(n) * time.Second % expiredScanInterval)
sleepFor := expiredScanInterval - (time.Duration(time.Now().Second()) % expiredScanInterval)
time.Sleep(sleepFor)
for id, captcha := range cdb.DB {