1
0
Fork 0

Fix 'sqlite3.OperationalError: cannot VACUUM from within a transaction'.

This commit is contained in:
Casper V. Kristensen 2019-06-07 21:29:26 +02:00
parent 92b41b0202
commit c70ed692e4
Signed by: caspervk
GPG key ID: 289CA03790535054

View file

@ -48,8 +48,8 @@ def clean(older_than=timedelta(days=3)):
""", {
"cutoff": (datetime.utcnow() - older_than).timestamp(),
})
connection.execute("VACUUM;")
connection.commit()
connection.executescript("VACUUM;")
last_request = defaultdict(float)