@@ -54,20 +54,20 @@ func main() {
54
54
" server1" : " localhost:6379" ,
55
55
},
56
56
})
57
- limiter := redis_rate.NewLimiter (ring)
58
- // Optional.
59
- limiter.Fallback = rate.NewLimiter (rate.Every (time.Second ), 100 )
60
-
61
- http.HandleFunc (" /" , func (w http.ResponseWriter , req *http.Request ) {
62
- handler (w, req, limiter)
63
- })
64
-
65
- http.HandleFunc (" /status" , func (w http.ResponseWriter , req *http.Request ) {
66
- statusHandler (w, req, limiter)
67
- })
68
-
69
- http.HandleFunc (" /favicon.ico" , http.NotFound )
70
- log.Println (" listening on localhost:8888..." )
71
- log.Println (http.ListenAndServe (" localhost:8888" , nil ))
57
+ limiter := redis_rate.NewLimiter (ring)
58
+ // Optional.
59
+ limiter.Fallback = rate.NewLimiter (rate.Every (time.Second ), 100 )
60
+
61
+ http.HandleFunc (" /" , func (w http.ResponseWriter , req *http.Request ) {
62
+ handler (w, req, limiter)
63
+ })
64
+
65
+ http.HandleFunc (" /status" , func (w http.ResponseWriter , req *http.Request ) {
66
+ statusHandler (w, req, limiter)
67
+ })
68
+
69
+ http.HandleFunc (" /favicon.ico" , http.NotFound )
70
+ log.Println (" listening on localhost:8888..." )
71
+ log.Println (http.ListenAndServe (" localhost:8888" , nil ))
72
72
}
73
73
```
0 commit comments