Repository navigation
fix(drive): retry and pace Google downloads - #108
Merged
Merged
Conversation
A 575-photo import died after ~380 files when Google answered with its "automated queries" block page, and the single-transaction import lost all progress. Send a proper User-Agent, pause 0.4s between API-key downloads, and retry with backoff (3s to 2min) on 429, 5xx and the block page instead of failing the whole import.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
First production import (Markathon, 575 photos) failed after ~650 MB with
Google file download failed: Sorry... automated queries. urllib's default User-Agent plus unthrottled bursts got the VPS IP rate-limited. The whole import runs in one transaction, so all progress was lost.Fix
Test
243 unit tests pass, ruff/mypy clean; new tests for the retry classifier, retry-then-succeed and no-retry-on-404.
Not in this PR
The import is still all-or-nothing in one transaction. Resumable per-batch commits would be the next improvement.