Skip to content

feat: add retry_transient_errors global option #1258

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gitlab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Gitlab(object):
api_version (str): Gitlab API version to use (support for 4 only)
pagination (str): Can be set to 'keyset' to use keyset pagination
order_by (str): Set order_by globally
retry_transient_errors (bool): Retry transient errors, defaults to False
"""

def __init__(
Expand All @@ -79,6 +80,7 @@ def __init__(
per_page=None,
pagination=None,
order_by=None,
retry_transient_errors=False,
):

self._api_version = str(api_version)
Expand Down Expand Up @@ -106,6 +108,7 @@ def __init__(
self.per_page = per_page
self.pagination = pagination
self.order_by = order_by
self.retry_transient_errors = retry_transient_errors

objects = importlib.import_module("gitlab.v%s.objects" % self._api_version)
self._objects = objects
Expand Down Expand Up @@ -202,6 +205,7 @@ def from_config(cls, gitlab_id=None, config_files=None):
per_page=config.per_page,
pagination=config.pagination,
order_by=config.order_by,
retry_transient_errors=retry_transient_errors,
)

def auth(self):
Expand Down