Skip to content

Commit 9769f63

Browse files
committed
optionaly store temp directory on download job for cleanup
1 parent 341795c commit 9769f63

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

mergin/client_pull.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@ class DownloadJob:
4444
"""
4545

4646
def __init__(
47-
self, project_path, total_size, version, update_tasks, download_queue_items, directory, mp, project_info
47+
self,
48+
project_path,
49+
total_size,
50+
version,
51+
update_tasks,
52+
download_queue_items,
53+
directory,
54+
mp,
55+
project_info,
56+
download_tmp_dir: typing.Optional[tempfile.TemporaryDirectory] = None,
4857
):
4958
self.project_path = project_path
5059
self.total_size = total_size # size of data to download (in bytes)
@@ -57,6 +66,7 @@ def __init__(
5766
self.is_cancelled = False
5867
self.project_info = project_info # parsed JSON with project info returned from the server
5968
self.failure_log_file = None # log file, copied from the project directory if download fails
69+
self.download_tmp_dir = download_tmp_dir # temporary directory for downloads if specified
6070

6171
def dump(self):
6272
print("--- JOB ---", self.total_size, "bytes")

0 commit comments

Comments
 (0)