Skip to content

Commit f8f2819

Browse files
committed
revert defaults
1 parent cc7022c commit f8f2819

File tree

1 file changed

+7
-1
lines changed
  • tools/src/main/python/opengrok_tools/utils

1 file changed

+7
-1
lines changed

tools/src/main/python/opengrok_tools/utils/restful.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def wait_for_async_api(response, api_timeout, headers=None, timeout=None):
7171
return response
7272

7373

74-
def do_api_call(verb, uri, params=None, headers=None, data=None, timeout=60, api_timeout=300):
74+
def do_api_call(verb, uri, params=None, headers=None, data=None, timeout=None, api_timeout=None):
7575
"""
7676
Perform an API call. Will raise an exception if the request fails.
7777
:param verb: string holding HTTP verb
@@ -92,6 +92,12 @@ def do_api_call(verb, uri, params=None, headers=None, data=None, timeout=60, api
9292
if handler is None or not callable(handler):
9393
raise Exception('Unknown HTTP verb: {}'.format(verb))
9494

95+
if timeout is None:
96+
timeout = 60
97+
98+
if api_timeout is None:
99+
api_timeout = 300
100+
95101
logger.debug("{} API call: {} with data '{}', connect timeout {} seconds, API timeout {} seconds and headers: {}".
96102
format(verb, uri, data, timeout, api_timeout, headers))
97103
r = handler(

0 commit comments

Comments
 (0)