File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -54,18 +54,18 @@ func main() {
54
54
" server1" : " localhost:6379" ,
55
55
},
56
56
})
57
- limiter := rate .NewLimiter (ring)
57
+ limiter := redis_rate .NewLimiter (ring)
58
58
// Optional.
59
- limiter.Fallback = timerate .NewLimiter (rate.Every (time.Second ), 100 )
60
-
59
+ limiter.Fallback = rate .NewLimiter (rate.Every (time.Second ), 100 )
60
+
61
61
http.HandleFunc (" /" , func (w http.ResponseWriter , req *http.Request ) {
62
62
handler (w, req, limiter)
63
63
})
64
-
64
+
65
65
http.HandleFunc (" /status" , func (w http.ResponseWriter , req *http.Request ) {
66
66
statusHandler (w, req, limiter)
67
67
})
68
-
68
+
69
69
http.HandleFunc (" /favicon.ico" , http.NotFound )
70
70
log.Println (" listening on localhost:8888..." )
71
71
log.Println (http.ListenAndServe (" localhost:8888" , nil ))
You can’t perform that action at this time.
0 commit comments