Add --no-locker param

This commit is contained in:
Dmitry Petrov
2017-04-18 09:08:40 -07:00
parent 3e5c7611aa
commit 378b56a303
6 changed files with 56 additions and 32 deletions
+8 -6
View File
@@ -30,17 +30,19 @@ class CmdDataRemove(CmdBase):
pass
def run(self):
lock = fasteners.InterProcessLock(self.git.lock_file)
gotten = lock.acquire(timeout=5)
if not gotten:
Logger.info('[Cmd-Remove] Cannot perform the cmd since DVC is busy and locked. Please retry the cmd later.')
return 1
if self.is_locker:
lock = fasteners.InterProcessLock(self.git.lock_file)
gotten = lock.acquire(timeout=5)
if not gotten:
Logger.info('[Cmd-Remove] Cannot perform the cmd since DVC is busy and locked. Please retry the cmd later.')
return 1
try:
if not self.remove_all_targets():
return 1
finally:
lock.release()
if self.is_locker:
lock.release()
return 0