dvc: make lock lifetime long by default

This commit is contained in:
Alexander Schepanovski
2019-09-11 14:21:12 +07:00
parent d9d85f3cb0
commit 3c3378bdca
2 changed files with 3 additions and 5 deletions
+3 -3
View File
@@ -35,7 +35,9 @@ if is_py3:
"""
def __init__(self, lockfile, lifetime=None, tmp_dir=None):
if isinstance(lifetime, int):
if lifetime is None:
lifetime = timedelta(days=365) # Lock for good by default
elif isinstance(lifetime, int):
lifetime = timedelta(seconds=lifetime)
self._tmp_dir = tmp_dir
@@ -81,8 +83,6 @@ else:
Uses zc.lockfile as backend.
"""
TIMEOUT = 5
def __init__(self, lockfile, lifetime=None, tmp_dir=None):
self.lockfile = lockfile
self._lock = None
-2
View File
@@ -72,8 +72,6 @@ class Repo(object):
self.lock = Lock(
os.path.join(self.dvc_dir, "lock"),
# This should be longer than operations we are protecting
lifetime=60 * 60 * 24 * 30,
tmp_dir=os.path.join(self.dvc_dir, "tmp"),
)
# NOTE: storing state and link_state in the repository itself to avoid