Skip to content

Needs to handle API throttling and error detection #82

@TenguTech

Description

@TenguTech

Summary
When importing large sets of photos from Flickr the plugin needs to handle API throttling and gracefully handle errors cause by it. Pausing after X API calls and/or detecting that it has been throttled then restarting later.

Description
I have just imported 3000+ photos from Flickr into a self hosted Piwigo instance.

I found that after about 990 photos are imported, the green photo imported message would change to a red error message with something about file size.

Sorry I don't have the exact message, but I think it was cause by getting Zero length file when trying to retrieve the photo due to API throttling.

If I waited a period of time and started again, I would get lots of green 'we all ready have the image' messages, then green importing new image messages, and finally red messages again when it got API throttled again.

Suggestions
I suggest the following:

  1. Pause the Import plugging after a set number of API calls
    I know when I checked the API stats after the first problem it said a bit over 2500 calls in not that long.
    The Flickr API documentation says no more than 3600 calls in an hour.
    So I think the API throttles for a fast rate in a short period of time.

Maybe the Plugin needs a 'self pause' function so it doesn't exceed this.

  1. The Plugin seems to need better error detection.
    If the plugin is getting the same error multiple times in a row maybe it should stop?

If you were getting photos and start to get Zero size file it probably means you are being throttled.
And it would be useful if gracefully handled.

Conclusion
I'm glad I don't have the 300,000 photos that needed to be imported by the person who reported issue #30
But trying to import even a few thousand photos seems to be a problem.

I think the plugin needs to self throttle so it doesn't exceed the 3600 calls an hour and exceed what appears to be a short burst limit.
It would also be useful if it detected errors that were caused by throttling and paused or self throttled in response.

For reference, here is the graph I got from having to run the import 3 times today.
The first call was done yesterday.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions