redup redis url

pull/136/head
Aevann 2023-03-01 21:49:17 +02:00
parent 95d1e69c68
commit ca1b25783f
2 changed files with 2 additions and 3 deletions

View File

@ -69,7 +69,7 @@ limiter = Limiter(
key_func=get_CF,
default_limits=[DEFAULT_RATELIMIT],
application_limits=["10/second;200/minute;5000/hour;10000/day"],
storage_uri=environ.get("REDIS_URL", "redis://localhost"),
storage_uri=app.config["CACHE_REDIS_URL"],
)
engine = create_engine(app.config['SQLALCHEMY_DATABASE_URL'])

View File

@ -50,8 +50,7 @@ def before_request():
g.nonce = secrets.token_urlsafe(31)
import redis
host = environ.get("REDIS_URL", "redis://localhost").split('://')[1].split(':')[0]
r = redis.Redis(host=host, port=6379, db=0)
r = redis.Redis.from_url(app.config["CACHE_REDIS_URL"])
@app.after_request
def after_request(response:Response):