Verified Commit 1258e6c5 authored by Vojtech Myslivec's avatar Vojtech Myslivec 🚀

apiv1: Refactor global parameter handling

parent eeb6621a
......@@ -16,12 +16,11 @@ apiv1 = Blueprint("apiv1", __name__)
def get_redis():
r = g.get('redis', None)
if r is None:
r = g.redis = redis.StrictRedis(host=current_app.config["REDIS_HOST"],
port=current_app.config["REDIS_PORT"],
password=current_app.config["REDIS_PASSWORD"])
return r
if "redis" not in g:
g.redis = redis.StrictRedis(host=current_app.config["REDIS_HOST"],
port=current_app.config["REDIS_PORT"],
password=current_app.config["REDIS_PASSWORD"])
return g.redis
def log_debug_json(msg, msg_json):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment