diff --git a/gallery_dl/job.py b/gallery_dl/job.py index 06c5875d..d5297050 100644 --- a/gallery_dl/job.py +++ b/gallery_dl/job.py @@ -266,6 +266,8 @@ class DownloadJob(Job): if self.postprocessors: for pp in self.postprocessors: pp.finalize() + if self.archive: + self.archive.close() def handle_skip(self): self.out.skip(self.pathfmt.path) diff --git a/gallery_dl/util.py b/gallery_dl/util.py index 17cd73a9..d87184de 100644 --- a/gallery_dl/util.py +++ b/gallery_dl/util.py @@ -733,6 +733,7 @@ class DownloadArchive(): def __init__(self, path, extractor): con = sqlite3.connect(path) con.isolation_level = None + self.close = con.close self.cursor = con.cursor() self.cursor.execute("CREATE TABLE IF NOT EXISTS archive " "(entry PRIMARY KEY) WITHOUT ROWID")