Restored old limits

This commit is contained in:
Manu Mtz-Almeida 2015-05-14 22:52:37 +02:00
parent e33ea855d7
commit 05d01d2282
1 changed files with 3 additions and 3 deletions

View File

@ -14,11 +14,11 @@ func rateLimit(c *gin.Context) {
ip := c.ClientIP() ip := c.ClientIP()
value := int(ips.Add(ip, 1)) value := int(ips.Add(ip, 1))
if value%10 == 0 { if value%50 == 0 {
fmt.Printf("ip: %s, count: %d\n", ip, value) fmt.Printf("ip: %s, count: %d\n", ip, value)
} }
if value >= 100 { if value >= 200 {
if value%100 == 0 { if value%200 == 0 {
fmt.Println("ip blocked") fmt.Println("ip blocked")
} }
c.Abort() c.Abort()