mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-23 21:47:04 +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()
|
||||
for m in q:
|
||||
db.session.delete(m)
|
||||
db.session.commit()
|
||||
|
||||
guilds = Guilds.query.all()
|
||||
for guild in guilds:
|
||||
@ -480,8 +481,8 @@ def cleanup_keyval_db():
|
||||
for idx, val in enumerate(dbmsg):
|
||||
if len(dbmsg) - idx > 50:
|
||||
db.session.delete(val)
|
||||
db.session.commit()
|
||||
else:
|
||||
continue
|
||||
db.session.commit()
|
||||
return ('', 204)
|
||||
abort(401)
|
||||
|
Loading…
Reference in New Issue
Block a user