diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-02-25 19:06:44 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-02-25 19:06:44 +0000 |
commit | c68ce8aeb216c642b10433626572c912a59eaaac (patch) | |
tree | 426e761c8b4471c06d0b649e16990c2e69852c27 | |
parent | 02acd50af6ad4d5bbeb594a386463aeb01bbd943 (diff) | |
download | obnam-c68ce8aeb216c642b10433626572c912a59eaaac.tar.gz |
Set default for --lock-timeout
-rw-r--r-- | obnamlib/app.py | 3 | ||||
-rw-r--r-- | obnamlib/repo.py | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/obnamlib/app.py b/obnamlib/app.py index dd0c19a1..1ccb9d27 100644 --- a/obnamlib/app.py +++ b/obnamlib/app.py @@ -88,7 +88,8 @@ class App(cliapp.Application): 'when locking in the backup repository, ' 'wait TIMEOUT seconds for an existing lock ' 'to go away before giving up', - metavar='TIMEOUT') + metavar='TIMEOUT', + default=60) # The following needs to be done here, because it needs # to be done before option processing. This is a bit ugly, diff --git a/obnamlib/repo.py b/obnamlib/repo.py index f32d76a6..5e464d07 100644 --- a/obnamlib/repo.py +++ b/obnamlib/repo.py @@ -132,7 +132,8 @@ class Repository(object): format_version = 5 def __init__(self, fs, node_size, upload_queue_size, lru_size, hooks, - idpath_depth, idpath_bits, idpath_skip, current_time): + idpath_depth, idpath_bits, idpath_skip, current_time, + lock_timeout): self.current_time = current_time self.setup_hooks(hooks or obnamlib.HookManager()) @@ -140,7 +141,7 @@ class Repository(object): self.node_size = node_size self.upload_queue_size = upload_queue_size self.lru_size = lru_size - self.lockmgr = obnamlib.LockManager(self.fs, 0) # FIXME: timeout + self.lockmgr = obnamlib.LockManager(self.fs, lock_timeout) self.got_root_lock = False self.clientlist = obnamlib.ClientList(self.fs, node_size, upload_queue_size, |