diff options
| author | Andrew Tergis <andrew.tergis@littlebits.com> | 2019-12-10 12:23:10 -0500 |
|---|---|---|
| committer | Andrew Tergis <andrew.tergis@littlebits.com> | 2019-12-16 13:45:38 -0500 |
| commit | e9a8289a381ebde7c57aa2364258d84b4771d276 (patch) | |
| tree | 2b8832fe06dfa0fb7e9fe700449644a8d8beaf16 /gitlab/__init__.py | |
| parent | aa4d41b70b2a66c3de5a7dd19b0f7c151f906630 (diff) | |
| download | gitlab-e9a8289a381ebde7c57aa2364258d84b4771d276.tar.gz | |
feat: allow cfg timeout to be overrided via kwargs
On startup, the `timeout` parameter is loaded from config and stored on
the base gitlab object instance. This instance parameter is used as the
timeout for all API requests (it's passed into the `session` object when
making HTTP calls).
This change allows any API method to specify a `timeout` argument to
`**kwargs` that will override the global timeout value. This was
somewhat needed / helpful for the `import_github` method.
I have also updated the docs accordingly.
Diffstat (limited to 'gitlab/__init__.py')
| -rw-r--r-- | gitlab/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index 03e5556..c4460a4 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -491,6 +491,8 @@ class Gitlab(object): verify = opts.pop("verify") timeout = opts.pop("timeout") + # If timeout was passed into kwargs, allow it to override the default + timeout = kwargs.get("timeout", timeout) # We need to deal with json vs. data when uploading files if files: |
