From 3db1479acccc9239b5f0a0078f09c7a9d66e3a5e Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Thu, 14 May 2015 20:52:45 +0200 Subject: [PATCH] More changes! --- examples/realtime-advanced/routes.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/realtime-advanced/routes.go b/examples/realtime-advanced/routes.go index ebb2f00..f982173 100644 --- a/examples/realtime-advanced/routes.go +++ b/examples/realtime-advanced/routes.go @@ -13,9 +13,11 @@ import ( func rateLimit(c *gin.Context) { ip := c.ClientIP() value := ips.Add(ip, 1) - fmt.Printf("ip: %s, count: %f\n", ip, value) - if value >= 300 { - if int(value)%300 == 0 { + if int(value)%50 == 0 { + fmt.Printf("ip: %s, count: %d\n", ip, int(value)) + } + if value >= 200 { + if int(value)%200 == 0 { fmt.Println("ip blocked") } c.AbortWithStatus(503)