-
Notifications
You must be signed in to change notification settings - Fork 108
Description
Bonjour @alexis-mignon , Hello @beaufour
First let me thank you a lot for this library and to restart the work on it.
I've been using it actively since a little more than a year to publish batches of photos (~200-250 per batch) and I have been fighting with Flickr limitations.
It may not look very much but because of our current infrastructure, I don't get a list of all photos to upload. We have an event driven system (AWS queue + AWS lambda) and I get 1 event per photo. So for each photo we have to redo it all again:
- login
- gather the full list of Photoset in the account,
- scan the list until I find the correct one by title
- If it doesn't exist, create it
- upload the photo using
flickr_api.upload(...)
And we can run up to 5 such flow simultaneously
Last week-end, we had to upload 140 photos.
It went well for 120 photos, but for 20 of them it failed
I already had implemented a retry mecansim around flickr_api.upload(...), with 1 retry after 30 seconds but for the 20 that failed, they all failed both the original attempt and the retry with
ReadTimeoutError("HTTPSConnectionPool(host='api.flickr.com', port=443): Read timed out. (read timeout=10)")
I was about to increase the number of retries and the delay between retries when I noticed the recent improvements.
Could you please kindly advise if and how the newly added methods could help me tackle this problem ?
refering to:
Implement opt-in rate limiting that throttles requests to respect
Flickr's documented 3600 requests/hour limit. This is proactive
throttling (sleeping before requests) as opposed to the existing
reactive retry handling (retrying after 429 responses).
New public functions:
- set_rate_limit(requests_per_hour) - Enable/disable rate limiting
- get_rate_limit() - Get current configuration
- get_rate_limit_status() - Get detailed status including interval
Internal function _maybe_wait_for_rate_limit() is called at the start
of _make_request_with_retry() to sleep if necessary before making
each request.
Thanks in advance