Commit b09a548e authored by Morten Brekkevold's avatar Morten Brekkevold
Browse files

Add option to set explicit timeout

Because:
- It's not clear whether the implicit timeout in the underlying library
  is "infinite" or some arbitrary value, but we keep getting timeouts
  in production.
parent a5cbacf4
......@@ -20,7 +20,7 @@ def _translate_notfounderror(func):
class NAVAPI(object):
def __init__(self, url, auth_token):
def __init__(self, url, auth_token, timeout=None):
self.api = API(
url,
headers={
......@@ -29,6 +29,7 @@ class NAVAPI(object):
},
append_slash=True,
json_encode_body=True,
timeout=timeout,
)
self.api.add_resource(resource_name="netbox")
self.api.add_resource(resource_name="room")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment