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() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
n := time.Now().Second()
|
sleepFor := expiredScanInterval - (time.Duration(time.Now().Second()) % expiredScanInterval)
|
||||||
sleepFor := expiredScanInterval - (time.Duration(n) * time.Second % expiredScanInterval)
|
|
||||||
time.Sleep(sleepFor)
|
time.Sleep(sleepFor)
|
||||||
|
|
||||||
for id, captcha := range cdb.DB {
|
for id, captcha := range cdb.DB {
|
||||||
|
Loading…
Reference in New Issue
Block a user