From be4050d1f549e55ef88c39335fb582a6c8dcd774 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 26 Jun 2022 20:36:36 +0400 Subject: [PATCH] Removed excessive variable n, and multiplying by time.Second. --- internal/captcha/db.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/captcha/db.go b/internal/captcha/db.go index 7342cbf..89aecce 100644 --- a/internal/captcha/db.go +++ b/internal/captcha/db.go @@ -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 {