8000 fix(sources): keep working when Google Drive rate limits by adeelahmad · Pull Request #288 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content 8000

fix(sources): keep working when Google Drive rate limits - #288

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-t4quwz
Oct 10, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-t4quwz

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: when Google Drive throttled an account, Lens treated the connection as broken. The connection showed a red error, a watched folder marked the file it couldn't fetch as an error for good (never retried), and once Drive's daily upload limit was hit, saving Lens's own files failed, even though reading from Drive still worked.

After: a throttled connection shows as working, slowly (◆ "Works, slowly · …"). Files a scan couldn't fetch wait for the next scan, and the rest of that scan waits too rather than hammering the account. While Drive refuses uploads, new files are kept on this machine (each records where it went) and files already on Drive are still read from there. Settings → Storage → Check it says "It works, but it's rate limited."

How: rclone's errors are classified: rate limit / quota / 429 messages raise sources.RateLimited. Drive gets rclone's default 10 low-level retries (it was 2, so a single throttle burst failed the call), and file-store copies pass --drive-stop-on-upload-limit so the daily upload limit fails fast instead of retrying for hours. Health and the file-store check carry a new limited field.

Motivation and Context

Reported in the project thread: Drive showed an error on a rate limit even though it could still download/read.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project.
  • I added or updated tests. (tests/api/test_rate_limits.py, with a fake rclone that throttles on demand; the real-rclone file store tests pass with the new flag.)
  • My change requires documentation updates, and I have updated docs/ accordingly.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G2TAAG5yQ66RzoXMi3MZdV


Generated by Claude Code

A throttled Drive account showed as a broken connection, a scan marked
the file it couldn't fetch as an error for good, and Lens's own files
failed to save once Drive's daily upload limit was hit, though reading
still worked. Now rate limits are told apart from failures: the check
shows the connection working (limited), rclone gets Drive's default 10
low-level retries, throttled scan files wait for the next scan, and new
files are kept on this machine while Drive refuses uploads.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G2TAAG5yQ66RzoXMi3MZdV
@adeelahmad adeelahmad self-assigned this Oct 10, 2026
@adeelahmad
adeelahmad merged commit 113ef78 into main Oct 10, 2026
7 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-t4quwz branch October 10, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0