feat: Handle LaunchDarkly rate limiting#5501
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
da8c190 to
82ceeb5
Compare
Uffizzi Ephemeral Environment Deploying☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/5501 ⚙️ Updating now by workflow run 15307046164. What is Uffizzi? Learn more! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5501 +/- ##
=======================================
Coverage 97.65% 97.66%
=======================================
Files 1237 1239 +2
Lines 43580 43677 +97
=======================================
+ Hits 42558 42657 +99
+ Misses 1022 1020 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Docker builds report
|
| djangorestframework-dataclasses = "^1.3.1" | ||
| pyotp = "^2.9.0" | ||
| flagsmith-common = "^1.13.0" | ||
| flagsmith-common = { git = "https://github.com/flagsmith/flagsmith-common", branch = "feat/task-backoff" } |
There was a problem hiding this comment.
Redirect back to PyPI after Flagsmith/flagsmith-common#81 is merged and released.
| def _handle_giveup( | ||
| details: Details, | ||
| ) -> None: | ||
| exc: RequestException = details["exception"] # type: ignore[typeddict-item] |
There was a problem hiding this comment.
This type ignore is an annoying one, especially considering the (otherwise excellent) backoff library is not maintained anymore.
NB: consider switching all backoff usage to stamina.
There was a problem hiding this comment.
We don't have to add TASK_BACKOFF_DEFAULT_DELAY_SECONDS used here?
| exc: RequestException = details["exception"] # type: ignore[typeddict-item] | ||
|
|
||
| if retry_after := _get_retry_after(exc): | ||
| raise LaunchDarklyRateLimitError( |
There was a problem hiding this comment.
It could be nice to log the project/org maybe if it's simple to access them here ?
@gagantrivedi Added in 445ebb8. |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature!Changes
Closes #5361.
This PR adds rate limiting handling for LaunchDarkly client.
If rate limiting persists after 5 tries, the whole import request is backed off using functionality added in Flagsmith/flagsmith-common#81.
How did you test this code?
Added a bunch of new unit tests.