Skip to content

Commit b7ae80e

Browse files
authored
Merge pull request #17 from nilyang/master
Readme example code bugfix
2 parents 31124b3 + 51ec01e commit b7ae80e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ func main() {
5454
"server1": "localhost:6379",
5555
},
5656
})
57-
limiter := rate.NewLimiter(ring)
57+
limiter := redis_rate.NewLimiter(ring)
5858
// Optional.
59-
limiter.Fallback = timerate.NewLimiter(rate.Every(time.Second), 100)
60-
59+
limiter.Fallback = rate.NewLimiter(rate.Every(time.Second), 100)
60+
6161
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
6262
handler(w, req, limiter)
6363
})
64-
64+
6565
http.HandleFunc("/status", func(w http.ResponseWriter, req *http.Request) {
6666
statusHandler(w, req, limiter)
6767
})
68-
68+
6969
http.HandleFunc("/favicon.ico", http.NotFound)
7070
log.Println("listening on localhost:8888...")
7171
log.Println(http.ListenAndServe("localhost:8888", nil))

0 commit comments

Comments
 (0)