remotes/1693045480750635534/spooky-22
parent
5e24df0b75
commit
0db887abc6
|
@ -127,6 +127,7 @@ r=redis.Redis(
|
||||||
connection_pool=redispool
|
connection_pool=redispool
|
||||||
) if app.config["CACHE_REDIS_URL"] else None
|
) if app.config["CACHE_REDIS_URL"] else None
|
||||||
|
|
||||||
|
db_session = scoped_session(sessionmaker(bind=_engine, query_cls=RetryingQuery))
|
||||||
|
|
||||||
# enforce https
|
# enforce https
|
||||||
@app.before_request
|
@app.before_request
|
||||||
|
@ -138,7 +139,7 @@ def before_request():
|
||||||
if app.config["BOT_DISABLE"] and request.headers.get("X-User-Type")=="Bot":
|
if app.config["BOT_DISABLE"] and request.headers.get("X-User-Type")=="Bot":
|
||||||
abort(503)
|
abort(503)
|
||||||
|
|
||||||
g.db = scoped_session(sessionmaker(bind=_engine, query_cls=RetryingQuery))
|
g.db = db_session()
|
||||||
|
|
||||||
g.timestamp = int(time.time())
|
g.timestamp = int(time.time())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue