mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-30 18:01:54 +00:00
ratelimit: add app config examples
This commit is contained in:
parent
5c943f35e3
commit
72087ddaaf
|
@ -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_"
|
||||
|
|
|
@ -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