mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 03:47:04 +00:00
minor (see prev commit)
Former-commit-id: 277b7b1517357d6baea98d771b592be2795201a3
This commit is contained in:
@@ -23,10 +23,10 @@ func newApp() *iris.Application {
|
||||
// Allow 1 request per second, with a maximum burst size of 5.
|
||||
//
|
||||
// Third optional variadic input parameter:
|
||||
// Can be a cleanup function.
|
||||
// Can be a cleanup function.
|
||||
// Iris provides a cleanup function that will check for old entries and remove them.
|
||||
// You can customize it, e.g. check every 1 minute
|
||||
// if a client's last visit was 5 minutes ago ("old" entry)
|
||||
// You can customize it, e.g. check every 1 minute
|
||||
// if a client's last visit was 5 minutes ago ("old" entry)
|
||||
// and remove it from the memory.
|
||||
rateLimiter := rate.Limit(1, 5, rate.PurgeEvery(time.Minute, 5*time.Minute))
|
||||
app.Use(rateLimiter)
|
||||
|
||||
Reference in New Issue
Block a user