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 {