diff options
| author | Gauvain Pocentek <gauvain@pocentek.net> | 2018-04-24 11:25:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-24 11:25:08 +0200 |
| commit | 86a825143fdae82d231c2c3589d81b26c8c3ab81 (patch) | |
| tree | d22fba22c60acb27edb158df0b808f8748f1534e /docs | |
| parent | 25ed8e73f352b7f542a418c4ca2c802e3d90d06f (diff) | |
| parent | e216f06d4d25d37a67239e93a8e2e400552be396 (diff) | |
| download | gitlab-86a825143fdae82d231c2c3589d81b26c8c3ab81.tar.gz | |
Merge pull request #488 from siemens/feat/rate-limit
feat: obey the rate limit
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api-usage.rst | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/api-usage.rst b/docs/api-usage.rst index 925f8bb..6513c9d 100644 --- a/docs/api-usage.rst +++ b/docs/api-usage.rst @@ -326,3 +326,26 @@ The following sample illustrates how to use a client-side certificate: Reference: http://docs.python-requests.org/en/master/user/advanced/#client-side-certificates + +Rate limits +----------- + +python-gitlab will obey the rate limit of the GitLab server by default. +On receiving a 429 response (Too Many Requests), python-gitlab will sleep for the amount of time +in the Retry-After header, that GitLab sends back. + +If you don't want to wait, you can disable the rate-limiting feature, by supplying the +``obey_rate_limit`` argument. + +.. code-block:: python + + import gitlab + import requests + + gl = gitlab.gitlab(url, token, api_version=4) + gl.projects.list(all=True, obey_rate_limit=False) + + +.. warning:: + + You will get an Exception, if you then go over the rate limit of your GitLab instance. |
