Skip to content

Commit

Permalink
fix default retries and backoff
Browse files Browse the repository at this point in the history
  • Loading branch information
uberfastman committed Jul 16, 2023
1 parent cec56db commit 89db402
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion yfpy/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def _authenticate(self) -> None:
if not self.oauth.token_is_valid():
self.oauth.refresh_access_token()

def get_response(self, url: str, retries: int = self._retries, backoff: int = self._backoff) -> Response:
def get_response(self, url: str, retries: Union[None, int] = None, backoff: Union[None, int] = None) -> Response:
"""Retrieve Yahoo Fantasy Sports data from the REST API.
Args:
Expand All @@ -178,6 +178,8 @@ def get_response(self, url: str, retries: int = self._retries, backoff: int = se
"""
logger.debug(f"Making request to URL: {url}")
response = self.oauth.session.get(url, params={"format": "json"}) # type: Response
retries = retries if retries is not None else self._retries
backoff = backoff if backoff is not None else self._backoff

status_code = response.status_code
# when you exceed Yahoo's allowed data request limits, they throw a request status code of 999
Expand Down

0 comments on commit 89db402

Please sign in to comment.