From b8123e0b267396a9ddcae6af3d86d4dee3ae50e8 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Fri, 19 Jan 2018 14:21:05 -0600 Subject: [PATCH] Explicitly VACUUM the cache on flush --- leech.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/leech.py b/leech.py index 9cc1be5..280bab8 100755 --- a/leech.py +++ b/leech.py @@ -5,6 +5,7 @@ import sys import json import http.cookiejar import logging +import sqlite3 import sites import ebook @@ -66,6 +67,11 @@ if __name__ == '__main__': if args.flush: requests_cache.install_cache('leech') requests_cache.clear() + + conn = sqlite3.connect('leech.sqlite') + conn.execute("VACUUM") + conn.close() + logger.info("Flushed cache") sys.exit()