mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
Add cachelock and fixed dashboard redirecting
This commit is contained in:
parent
1daa21d930
commit
fd5cc7eb2a
@ -62,7 +62,8 @@ def dashboard():
|
|||||||
if not guilds:
|
if not guilds:
|
||||||
session["redirect"] = url_for("user.dashboard")
|
session["redirect"] = url_for("user.dashboard")
|
||||||
return redirect(url_for("user.logout"))
|
return redirect(url_for("user.logout"))
|
||||||
if session["redirect"]:
|
error = request.args.get("error")
|
||||||
|
if session["redirect"] and not (error and error == "access_denied"):
|
||||||
redir = session['redirect']
|
redir = session['redirect']
|
||||||
session['redirect'] = None
|
session['redirect'] = None
|
||||||
return redirect(redir)
|
return redirect(redir)
|
||||||
@ -77,6 +78,7 @@ def administrate_guild(guild_id):
|
|||||||
if guild['code'] != 200:
|
if guild['code'] != 200:
|
||||||
session["redirect"] = url_for("user.administrate_guild", guild_id=guild_id, _external=True)
|
session["redirect"] = url_for("user.administrate_guild", guild_id=guild_id, _external=True)
|
||||||
return redirect(generate_bot_invite_url(guild_id))
|
return redirect(generate_bot_invite_url(guild_id))
|
||||||
|
session["redirect"] = None
|
||||||
db_guild = db.session.query(Guilds).filter(Guilds.guild_id == guild_id).first()
|
db_guild = db.session.query(Guilds).filter(Guilds.guild_id == guild_id).first()
|
||||||
if not db_guild:
|
if not db_guild:
|
||||||
db_guild = Guilds(guild_id)
|
db_guild = Guilds(guild_id)
|
||||||
|
@ -10,6 +10,7 @@ import hashlib
|
|||||||
|
|
||||||
cache_opts = {
|
cache_opts = {
|
||||||
'cache.type': 'ext:database',
|
'cache.type': 'ext:database',
|
||||||
|
'cache.lock_dir': 'tmp/cachelock',
|
||||||
'cache.url': config["database-uri"],
|
'cache.url': config["database-uri"],
|
||||||
'cache.sa.pool_recycle': 250,
|
'cache.sa.pool_recycle': 250,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user