Skip to content

Wait out Tolgee's rate limit instead of failing the import - #3

Merged
FabioHAraujo merged 1 commit into
mainfrom
fix/tolgee-rate-limit
Oct 23, 2026
Merged

FabioHAraujo merged 1 commit into
mainfrom
fix/tolgee-rate-limit

Conversation

@FabioHAraujo

Copy link
Copy Markdown
Contributor

A real 160k-key import stopped at 49,000 keys with 429 rate_limited, retryAfter: 11730. Self-hosted Tolgee allows 100 translation requests per user every 5 minutes (tolgee.rate-limits.translation-request-limit), so at 500 keys per page the limit hits around page 98, and LowLex's six blind retries (up to 32 s) were not enough and also counted as strikes.

  • The Tolgee client now waits exactly what Tolgee asks (retryAfter in the body, or Retry-After), up to 2 hours per request, then continues. Server errors and network errors keep the short backoff.
  • The import job reports the wait; the Tasks page and the project strip show "Tolgee asked to slow down: waiting …".
  • Test: a fake Tolgee answers 429 with retryAfter in the middle of the import; the import finishes without refetching pages.

With Tolgee's default limits a 160k-key project takes about 16 minutes (320 pages at 100 per 5 minutes); raising or disabling Tolgee's endpoint limits makes it as fast as Tolgee can answer. Deployed to the dev server, where the stopped import can be retried from key 49,000.

Tolgee allows 100 translation requests per user every 5 minutes by default,
so a 160k-key project (320 pages) hit 429 around page 98. The client now
waits as long as Tolgee's retryAfter asks (up to 2 hours per request) instead
of retrying blindly, which also added strikes that get connections dropped.
The Tasks page and the project strip show the wait.
@FabioHAraujo
FabioHAraujo merged commit 26b6871 into main Oct 23, 2026
6 checks passed
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.

1 participant