1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-26 12:42:29 +01:00

close archive on job completion (#417)

This commit is contained in:
Mike Fährmann 2019-09-10 22:26:40 +02:00
parent 5ac9732adc
commit 776e9e073f
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 3 additions and 0 deletions

View File

@ -266,6 +266,8 @@ class DownloadJob(Job):
if self.postprocessors: if self.postprocessors:
for pp in self.postprocessors: for pp in self.postprocessors:
pp.finalize() pp.finalize()
if self.archive:
self.archive.close()
def handle_skip(self): def handle_skip(self):
self.out.skip(self.pathfmt.path) self.out.skip(self.pathfmt.path)

View File

@ -733,6 +733,7 @@ class DownloadArchive():
def __init__(self, path, extractor): def __init__(self, path, extractor):
con = sqlite3.connect(path) con = sqlite3.connect(path)
con.isolation_level = None con.isolation_level = None
self.close = con.close
self.cursor = con.cursor() self.cursor = con.cursor()
self.cursor.execute("CREATE TABLE IF NOT EXISTS archive " self.cursor.execute("CREATE TABLE IF NOT EXISTS archive "
"(entry PRIMARY KEY) WITHOUT ROWID") "(entry PRIMARY KEY) WITHOUT ROWID")