Open
Description
Thanks @JohnVillalovos! Would it make sense to add another case to
python-gitlab/tests/functional/api/test_gitlab.py
Lines 160 to 183 in 4cb7d92
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 yield
to make it more reusable, e.g.)
@pytest.fixture
def rate_limit_settings(gl):
settings = gl.settings.get()
settings.throttle_authenticated_api_enabled = True
settings.throttle_authenticated_api_requests_per_period = 1
settings.throttle_authenticated_api_period_in_seconds = 3
settings.save()
yield settings
settings.throttle_authenticated_api_enabled = False
settings.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
Originally posted by @nejch in #1895 (comment)