Removed excessive variable n, and multiplying by time.Second.
This commit is contained in:
parent
0c1972461e
commit
be4050d1f5
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user