ratelimit: add app config examples

This commit is contained in:
Nicolas F 2020-06-22 23:27:17 +02:00 committed by Nicolas F
parent 5c943f35e3
commit 72087ddaaf
2 changed files with 10 additions and 1 deletions

View File

@ -209,3 +209,12 @@ CACHE_THRESHOLD = 8192
# CACHE_TYPE = "redis"
# CACHE_REDIS_HOST = "127.0.0.1"
# CACHE_KEY_PREFIX = "catcache_"
###############
## Ratelimit ##
###############
# To actually make this work across multiple worker processes, use redis
# RATELIMIT_STORAGE_URL="redis://host:port"
RATELIMIT_KEY_PREFIX="nyaaratelimit_"

View File

@ -128,7 +128,7 @@ def create_app(config):
# Cache
cache.init_app(app, config=app.config)
# Rate Limiting
# Rate Limiting, reads app.config itself
limiter.init_app(app)
return app