Open TimidRobot opened 1 year ago
The requests session is currently hardcoded: https://github.com/sybrenstuvel/flickrapi/blob/c389ce998766691350ce0127cf2fcb67f60c451d/flickrapi/auth.py#L143
Easiest change would be to allow the user to specify the session in FlickrAPI() and pass it to OAuthFlickrInterface.
FlickrAPI()
OAuthFlickrInterface
The the user could configure exponential backoff themselves:
from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry
# Requests configurations max_retries = Retry( # try again after 5, 10, 20, 40, 80 seconds # for specified HTTP status codes total=5, backoff_factor=10, status_forcelist=[403, 408, 429, 500, 502, 503, 504], ) session = requests.Session() session.mount("https://", HTTPAdapter(max_retries=max_retries))
etc.
Issue
The requests session is currently hardcoded: https://github.com/sybrenstuvel/flickrapi/blob/c389ce998766691350ce0127cf2fcb67f60c451d/flickrapi/auth.py#L143
Potential Solution
Easiest change would be to allow the user to specify the session in
FlickrAPI()
and pass it toOAuthFlickrInterface
.The the user could configure exponential backoff themselves:
etc.
Additional context