mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-25 06:27:03 +01:00
Cleanup db commit more often
Maybe this will fix the issue
This commit is contained in:
parent
afc198363d
commit
efcd2d9a83
@ -470,6 +470,7 @@ def cleanup_keyval_db():
|
|||||||
q = KeyValueProperties.query.filter(KeyValueProperties.expiration < datetime.datetime.now()).all()
|
q = KeyValueProperties.query.filter(KeyValueProperties.expiration < datetime.datetime.now()).all()
|
||||||
for m in q:
|
for m in q:
|
||||||
db.session.delete(m)
|
db.session.delete(m)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
guilds = Guilds.query.all()
|
guilds = Guilds.query.all()
|
||||||
for guild in guilds:
|
for guild in guilds:
|
||||||
@ -480,8 +481,8 @@ def cleanup_keyval_db():
|
|||||||
for idx, val in enumerate(dbmsg):
|
for idx, val in enumerate(dbmsg):
|
||||||
if len(dbmsg) - idx > 50:
|
if len(dbmsg) - idx > 50:
|
||||||
db.session.delete(val)
|
db.session.delete(val)
|
||||||
|
db.session.commit()
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
db.session.commit()
|
|
||||||
return ('', 204)
|
return ('', 204)
|
||||||
abort(401)
|
abort(401)
|
||||||
|
Loading…
Reference in New Issue
Block a user