Skip to content

Commit

Permalink
Restored old limits
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed May 14, 2015
1 parent 564b399 commit 447a99a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions realtime-advanced/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ func rateLimit(c *gin.Context) {

ip := c.ClientIP()
value := int(ips.Add(ip, 1))
if value%10 == 0 {
if value%50 == 0 {
fmt.Printf("ip: %s, count: %d\n", ip, value)
}
if value >= 100 {
if value%100 == 0 {
if value >= 200 {
if value%200 == 0 {
fmt.Println("ip blocked")
}
c.Abort()
Expand Down

0 comments on commit 447a99a

Please sign in to comment.