Skip to content

Commit 20c98c3

Browse files
Noordsesternd-biehl
authored andcommitted
feat(robot): environment variable for load library timeout
Closes #505
1 parent a6ffcf5 commit 20c98c3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/robot/src/robotcode/robot/diagnostics/imports_manager.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
REST_EXTENSIONS = (".rst", ".rest")
9797

9898

99-
LOAD_LIBRARY_TIME_OUT = 10
100-
COMPLETE_LIBRARY_IMPORT_TIME_OUT = COMPLETE_RESOURCE_IMPORT_TIME_OUT = COMPLETE_VARIABLES_IMPORT_TIME_OUT = 5
99+
LOAD_LIBRARY_TIMEOUT: int = int(os.environ.get("ROBOTCODE_LOAD_LIBRARY_TIMEOUT", 10))
100+
COMPLETE_LIBRARY_IMPORT_TIMEOUT = COMPLETE_RESOURCE_IMPORT_TIMEOUT = COMPLETE_VARIABLES_IMPORT_TIMEOUT = 5
101101

102102

103103
class _EntryKey:
@@ -1266,7 +1266,7 @@ def _get_library_libdoc(
12661266
base_dir,
12671267
self.get_resolvable_command_line_variables(),
12681268
variables,
1269-
).result(LOAD_LIBRARY_TIME_OUT)
1269+
).result(LOAD_LIBRARY_TIMEOUT)
12701270

12711271
except TimeoutError as e:
12721272
raise RuntimeError(f"Timeout loading library {name}({args!r})") from e
@@ -1438,7 +1438,7 @@ def _get_variables_libdoc(
14381438
base_dir,
14391439
self.get_resolvable_command_line_variables() if resolve_command_line_vars else None,
14401440
variables,
1441-
).result(LOAD_LIBRARY_TIME_OUT)
1441+
).result(LOAD_LIBRARY_TIMEOUT)
14421442

14431443
except TimeoutError as e:
14441444
raise RuntimeError(f"Timeout loading library {name}({args!r})") from e
@@ -1608,7 +1608,7 @@ def complete_library_import(
16081608
base_dir,
16091609
self.get_resolvable_command_line_variables(),
16101610
variables,
1611-
).result(COMPLETE_LIBRARY_IMPORT_TIME_OUT)
1611+
).result(COMPLETE_LIBRARY_IMPORT_TIMEOUT)
16121612

16131613
def complete_resource_import(
16141614
self,
@@ -1623,7 +1623,7 @@ def complete_resource_import(
16231623
base_dir,
16241624
self.get_resolvable_command_line_variables(),
16251625
variables,
1626-
).result(COMPLETE_RESOURCE_IMPORT_TIME_OUT)
1626+
).result(COMPLETE_RESOURCE_IMPORT_TIMEOUT)
16271627

16281628
def complete_variables_import(
16291629
self,
@@ -1638,7 +1638,7 @@ def complete_variables_import(
16381638
base_dir,
16391639
self.get_resolvable_command_line_variables(),
16401640
variables,
1641-
).result(COMPLETE_VARIABLES_IMPORT_TIME_OUT)
1641+
).result(COMPLETE_VARIABLES_IMPORT_TIMEOUT)
16421642

16431643
def resolve_variable(
16441644
self,

0 commit comments

Comments
 (0)