From c70ed692e4b88a959d5304dfe12f171345337bd7 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Fri, 7 Jun 2019 21:29:26 +0200 Subject: [PATCH] Fix 'sqlite3.OperationalError: cannot VACUUM from within a transaction'. --- dailyreleases/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dailyreleases/cache.py b/dailyreleases/cache.py index a27b11f..b39595e 100644 --- a/dailyreleases/cache.py +++ b/dailyreleases/cache.py @@ -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)