1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-11-14 06:19:14 +00:00

ratelimit: add app config examples

This commit is contained in:
Nicolas F 2020-06-22 23:27:17 +02:00
parent b27686ccab
commit 6ec934a77e
2 changed files with 10 additions and 1 deletions

View file

@ -205,3 +205,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