Skip to content

Commit 37a2560

Browse files
committed
fix the api_timeout usage
1 parent 6246a3e commit 37a2560

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,13 @@ def check_call_config(call):
7474

7575
call_timeout = call.get(API_TIMEOUT_PROPERTY)
7676
if call_timeout:
77-
try:
78-
int(call_timeout)
79-
except ValueError as exc:
80-
raise CommandConfigurationException(f"{API_TIMEOUT_PROPERTY} not an integer", exc)
77+
if call_timeout.startswith("$"):
78+
pass
79+
else:
80+
try:
81+
int(call_timeout)
82+
except ValueError as exc:
83+
raise CommandConfigurationException(f"{API_TIMEOUT_PROPERTY} not an integer", exc)
8184

8285
call_api_timeout = call.get(ASYNC_API_TIMEOUT_PROPERTY)
8386
if call_api_timeout:
@@ -138,7 +141,7 @@ def __init__(self, call_dict):
138141
if call_timeout.startswith("$"):
139142
call_timeout = os.environ.get(call_timeout[1:], "")
140143
if call_timeout.isdigit():
141-
self.api_timeout = call_timeout
144+
self.api_timeout = int(call_timeout)
142145

143146
self.async_api_timeout = None
144147
call_api_timeout = call_dict.get(ASYNC_API_TIMEOUT_PROPERTY)

0 commit comments

Comments
 (0)