mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 09:10:00 +00:00
ratelimit: add app config examples
This commit is contained in:
parent
b27686ccab
commit
6ec934a77e
|
@ -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_"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue