Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a _retries variable #219

Merged
merged 1 commit into from
Jan 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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