Skip to content

Commit 437661f

Browse files
authored
Merge pull request #32 from EBI-Metagenomics/develop
Prep for new release
2 parents 31e11c2 + a7981fa commit 437661f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fetchtool/abstract_fetch.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ def write_project_download_file(self, project_accession, new_rows):
343343
self.create_empty_file(download_file)
344344

345345
lock_file = download_file + ".lock"
346-
# Lock for 1 minute
347-
with Lock(lock_file, lifetime=60):
346+
# Lock for 1 minute, timeout after 10 minutes to avoid deadlocking the code if it can't get the lock
347+
with Lock(lock_file, lifetime=60, default_timeout=60 * 10):
348348
existing_rows = set(self.read_download_data(project_accession))
349349
existing_rows = existing_rows.union(set(new_download_rows))
350350
with open(download_file, "w+") as f:
@@ -412,7 +412,8 @@ def write_project_description_file(self, project_accession, new_rows):
412412

413413
lock_file = project_file + ".lock"
414414
# We lock the file for 2 minutes, should be enough
415-
with Lock(lock_file, lifetime=120):
415+
# The timeout will prevent a deadlock, if within 10 minutes it can't get the lock it will timeout and exit
416+
with Lock(lock_file, lifetime=120, default_timeout=60 * 10):
416417
# Fallback in case empty file exists
417418
try:
418419
project_runs = self.read_project_description_file(project_accession)

0 commit comments

Comments
 (0)