Skip to content

Commit

Permalink
Added a _retries variable at the main module file (musicbrainz.py
Browse files Browse the repository at this point in the history
…). Underscored so people only use if they know what they're doing.

Solved issues alastair#174 and alastair#218.

Signed-off-by: Itay Brandes <[email protected]>
  • Loading branch information
iTaybb committed May 10, 2017
1 parent 3b8edad commit 6ea48da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion musicbrainzngs/musicbrainz.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

_version = "0.7dev"
_log = logging.getLogger("musicbrainzngs")
_max_retries = 8

LUCENE_SPECIAL = r'([+\-&|!(){}\[\]\^"~*?:\\\/])'

Expand Down Expand Up @@ -461,7 +462,7 @@ def get_method(self):

# Core (internal) functions for calling the MB API.

def _safe_read(opener, req, body=None, max_retries=8, retry_delay_delta=2.0):
def _safe_read(opener, req, body=None, max_retries=_max_retries, retry_delay_delta=2.0):
"""Open an HTTP request with a given URL opener and (optionally) a
request body. Transient errors lead to retries. Permanent errors
and repeated errors are translated into a small set of handleable
Expand Down

0 comments on commit 6ea48da

Please sign in to comment.