1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 17:27:31 +00:00

Merge pull request #778 from borgbackup/1.0-maint

merge 1.0 maint
This commit is contained in:
TW 2016-03-19 22:02:57 +01:00
commit 2f7d8aaffb

View file

@ -33,7 +33,8 @@ def __init__(self, timeout=None, sleep=None):
:param timeout: time out interval [s] or None (no timeout) :param timeout: time out interval [s] or None (no timeout)
:param sleep: sleep interval [s] (>= 0: do sleep call, <0: don't call sleep) :param sleep: sleep interval [s] (>= 0: do sleep call, <0: don't call sleep)
or None (autocompute: use 10% of timeout, or 1s for no timeout) or None (autocompute: use 10% of timeout [but not more than 60s],
or 1s for no timeout)
""" """
if timeout is not None and timeout < 0: if timeout is not None and timeout < 0:
raise ValueError("timeout must be >= 0") raise ValueError("timeout must be >= 0")
@ -42,7 +43,7 @@ def __init__(self, timeout=None, sleep=None):
if timeout is None: if timeout is None:
sleep = 1.0 sleep = 1.0
else: else:
sleep = timeout / 10.0 sleep = min(60.0, timeout / 10.0)
self.sleep_interval = sleep self.sleep_interval = sleep
self.start_time = None self.start_time = None
self.end_time = None self.end_time = None