Explorar o código

Call Collect on a separate goroutine.

Dmitry Chestnykh %!s(int64=15) %!d(string=hai) anos
pai
achega
f9f7db1f43
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      captcha.go

+ 1 - 1
captcha.go

@@ -73,7 +73,7 @@ func New() string {
 	store.exp.PushBack(expValue{time.Seconds(), id})
 	store.exp.PushBack(expValue{time.Seconds(), id})
 	store.colNum++
 	store.colNum++
 	if store.colNum > CollectNum {
 	if store.colNum > CollectNum {
-		Collect()
+		go Collect()
 		store.colNum = 0
 		store.colNum = 0
 	}
 	}
 	return id
 	return id