Cleanup db commit more often

Maybe this will fix the issue
This commit is contained in:
Jeremy "EndenDragon" Zhang 2017-06-24 10:48:47 -07:00 committed by GitHub
parent afc198363d
commit efcd2d9a83

View File

@ -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)