We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5eb1b5 commit 880e77bCopy full SHA for 880e77b
musicbrainzngs/musicbrainz.py
@@ -23,9 +23,27 @@
23
_version = "0.7dev"
24
_log = logging.getLogger("musicbrainzngs")
25
26
-_retry = Retry(total=8,
27
- status_forcelist=[500, 502, 503],
28
- backoff_factor=0.1)
+
+class MBRetry(Retry):
+ """Retry class whose backoff time is::
29
30
+ { number of observed errors } * 2.0
31
32
+ """
33
34
+ def get_backoff_time(self):
35
+ """ Formula for computing the current backoff
36
37
+ :rtype: float
38
39
+ if self._observed_errors == 0:
40
+ return 0
41
42
+ return self._observed_errors * 2.0
43
44
45
+_retry = MBRetry(total=8,
46
+ status_forcelist=[500, 502, 503])
47
48
LUCENE_SPECIAL = r'([+\-&|!(){}\[\]\^"~*?:\\\/])'
49
0 commit comments