Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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
5 changes: 2 additions & 3 deletions 5 src/nypl_py_utils/classes/oauth2_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ def get(self, request_path, **kwargs):
resp.message = 'Oauth2 Client: Bad response from OauthClient'
resp.status_code = 500
self.logger.warning(f'Get request using path {request_path} \
returned response text:\n{resp.text}')
returned response text:\n{resp.text}')
# if client has specified that we want to retry failed requests and
# we haven't hit max retries
if self.with_retries is True:
retries = kwargs.get('retries', 0) + 1
if retries < 3:
self.logger.warning(
f'Retrying get request due to empty response from\
Oauth2 Client using path: {request_path}. \
Retry #{retries}')
Oauth2 Client using path: {request_path}. Retry #{retries}')
sleep(pow(2, retries - 1))
kwargs['retries'] = retries
# try request again
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.