Skip to content

Commit

Permalink
Merge pull request #21 from devopsarr/feature/devopsarr/prowlarr-py#11
Browse files Browse the repository at this point in the history
feat(devopsarr/prowlarr-py#11): add request timeout to config
  • Loading branch information
Fuochi authored May 17, 2023
2 parents bf2a53b + c0b1b0e commit d7bbe60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions templates/py/api_client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ class ApiClient(object):
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 templates/py/configuration.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,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.
{{#hasHttpSignatureMethods}}
:param signing_info: Configuration parameters for the HTTP signature security scheme.
Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration
Expand Down Expand Up @@ -170,6 +171,7 @@ conf = {{{packageName}}}.Configuration(
username=None, password=None,
discard_unknown_keys=False,
disabled_client_side_validations="",
request_timeout=None,
{{#hasHttpSignatureMethods}}
signing_info=None,
{{/hasHttpSignatureMethods}}
Expand Down Expand Up @@ -215,6 +217,9 @@ conf = {{{packageName}}}.Configuration(
"""
self.discard_unknown_keys = discard_unknown_keys
self.disabled_client_side_validations = disabled_client_side_validations
self.request_timeout = request_timeout
"""Request Timeout
"""
{{#hasHttpSignatureMethods}}
if signing_info is not None:
signing_info.host = host
Expand Down

0 comments on commit d7bbe60

Please sign in to comment.