Always commit before Db VACUUM

This commit is contained in:
shortcutme 2019-04-15 22:11:44 +02:00
parent 572d55752c
commit 446641c31c
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
2 changed files with 2 additions and 1 deletions

View File

@ -130,5 +130,4 @@ class ChartDb(Db):
{"date_added_limit": time.time() - 60 * 60 * 24 * 30 }
)
if week_back > 1:
self.commit("vacuum")
self.execute("VACUUM")

View File

@ -83,6 +83,8 @@ class DbCursor:
return query, params
def execute(self, query, params=None):
if query.upper().strip("; ") == "VACUUM":
self.db.commit("vacuum called")
query = query.strip()
while self.db.progress_sleeping:
time.sleep(0.1)