Skip to content

Commit

Permalink
Merge pull request #21 from devopsarr/feature/code-generation
Browse files Browse the repository at this point in the history
feat(devopsarr/prowlarr-py#11): add request timeout to config
  • Loading branch information
devopsarr[bot] authored May 17, 2023
2 parents aa3e6ca + ff03ca7 commit f4d7222
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sonarr/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ def __call_api(
resource_path, method, body,
request_auth=_request_auth)

# request timeout
if not _request_timeout:
_request_timeout = config.request_timeout

# body
if body:
body = self.sanitize_for_serialization(body)
Expand Down
5 changes: 5 additions & 0 deletions sonarr/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class Configuration(object):
disabled. This can be useful to troubleshoot data validation problem, such as
when the OpenAPI document validation rules do not match the actual API data
received by the server.
:param request_timeout: Default request timeout.
:param server_index: Index to servers configuration.
:param server_variables: Mapping with string values to replace variables in
templated server configuration. The validation of enums is performed for
Expand Down Expand Up @@ -109,6 +110,7 @@ def __init__(self, host=None,
username=None, password=None,
discard_unknown_keys=False,
disabled_client_side_validations="",
request_timeout=None,
server_index=None, server_variables=None,
server_operation_index=None, server_operation_variables=None,
ssl_ca_cert=None,
Expand Down Expand Up @@ -151,6 +153,9 @@ def __init__(self, host=None,
"""
self.discard_unknown_keys = discard_unknown_keys
self.disabled_client_side_validations = disabled_client_side_validations
self.request_timeout = request_timeout
"""Request Timeout
"""
self.logger = {}
"""Logging Settings
"""
Expand Down

0 comments on commit f4d7222

Please sign in to comment.