mirror of
https://github.com/ProjectSynthoria/SynthoriaArchive.git
synced 2025-03-12 07:26:54 +02:00
ratelimit: add app config examples
This commit is contained in:
parent
5c943f35e3
commit
72087ddaaf
2 changed files with 10 additions and 1 deletions
|
@ -209,3 +209,12 @@ CACHE_THRESHOLD = 8192
|
||||||
# CACHE_TYPE = "redis"
|
# CACHE_TYPE = "redis"
|
||||||
# CACHE_REDIS_HOST = "127.0.0.1"
|
# CACHE_REDIS_HOST = "127.0.0.1"
|
||||||
# CACHE_KEY_PREFIX = "catcache_"
|
# 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
|
||||||
cache.init_app(app, config=app.config)
|
cache.init_app(app, config=app.config)
|
||||||
|
|
||||||
# Rate Limiting
|
# Rate Limiting, reads app.config itself
|
||||||
limiter.init_app(app)
|
limiter.init_app(app)
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|
Loading…
Add table
Reference in a new issue