Browse Source

Optimize code

Volodymyr Tkach 2 years ago
parent
commit
9ee8947c3e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      utils/http/servlimit/servlimit.go

+ 1 - 1
utils/http/servlimit/servlimit.go

@@ -33,7 +33,7 @@ func ReqPerSecond(handler http.Handler, requests int) http.Handler {
 			// Reset counter
 			// Reset counter
 			if (time.Now().UTC().Unix() - ltime) >= 1 {
 			if (time.Now().UTC().Unix() - ltime) >= 1 {
 				reqs = 0
 				reqs = 0
-				mRequests.SetCount(ip, 0)
+				mRequests.SetCount(ip, reqs)
 			}
 			}
 
 
 			// Restrict access
 			// Restrict access