mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-07 07:18:27 +01:00
dvc: make lock lifetime long by default
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user