소스 검색

Merge pull request #778 from borgbackup/1.0-maint

merge 1.0 maint
TW 9 년 전
부모
커밋
2f7d8aaffb
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      borg/locking.py

+ 3 - 2
borg/locking.py

@@ -33,7 +33,8 @@ class TimeoutTimer:
 
         :param timeout: time out interval [s] or None (no timeout)
         :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:
             raise ValueError("timeout must be >= 0")
@@ -42,7 +43,7 @@ class TimeoutTimer:
             if timeout is None:
                 sleep = 1.0
             else:
-                sleep = timeout / 10.0
+                sleep = min(60.0, timeout / 10.0)
         self.sleep_interval = sleep
         self.start_time = None
         self.end_time = None