- Notifications
You must be signed in to change notification settings - Fork673
fix: support RateLimit-Reset header#1895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codecov-commenter commentedFeb 17, 2022
Codecov Report
@@ Coverage Diff @@## main #1895 +/- ##==========================================- Coverage 92.55% 92.53% -0.02%========================================== Files 78 78 Lines 4889 4891 +2 ==========================================+ Hits 4525 4526 +1- Misses 364 365 +1
Flags with carried forward coverage won't be shown.Click here to find out more.
|
Some endpoints are not returning the `Retry-After` header whenrate-limiting occurrs. In those cases use the `RateLimit-Reset` [1]header, if available.Closes:#1889[1]https://docs.gitlab.com/ee/user/admin_area/settings/user_and_ip_rate_limits.html#response-headers
65c7e62
to4060146
CompareThanks@JohnVillalovos! Would it make sense to add another case to python-gitlab/tests/functional/api/test_gitlab.py Lines 160 to 183 in4cb7d92
retry-after , e.g.user as mentioned in the issue? Although this might need 14.8 and not sure if it's enabled by default. Just wondering.https://docs.gitlab.com/ee/user/admin_area/settings/rate_limit_on_users_api.html#rate-limits-on-users-api(If we do this, I would maybe turn the settings into a fixture to use in both tests, and do the cleanup after @pytest.fixturedefrate_limit_settings(gl):settings=gl.settings.get()settings.throttle_authenticated_api_enabled=Truesettings.throttle_authenticated_api_requests_per_period=1settings.throttle_authenticated_api_period_in_seconds=3settings.save()yieldsettingssettings.throttle_authenticated_api_enabled=Falsesettings.save() PS: Interesting, looks like these headers are also useful to avoid 429s altogether, looking at go-gitlab with some fancy rate-limiting code:xanzy/go-gitlab@d8bb0b4 |
Uh oh!
There was an error while loading.Please reload this page.
Some endpoints are not returning the
Retry-After
header whenrate-limiting occurrs. In those cases use the
RateLimit-Reset
[1]header, if available.
Closes:#1889
[1]https://docs.gitlab.com/ee/user/admin_area/settings/user_and_ip_rate_limits.html#response-headers