mirror of
https://github.com/kemayo/leech
synced 2025-12-24 01:10:47 +01:00
Explicitly VACUUM the cache on flush
This commit is contained in:
parent
2042f813d0
commit
b8123e0b26
1 changed files with 6 additions and 0 deletions
6
leech.py
6
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()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue