Skip to content

Commit 7053bb4

Browse files
author
Mostafa Daoud
committed
add SleepDuration to config_file
1 parent 661d2f2 commit 7053bb4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

PyStemmusScope/bmi/local_process.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def __init__(self, cfg_file: str) -> None:
8686
"""Initialize the process."""
8787
self.cfg_file = cfg_file
8888
config = read_config(cfg_file)
89-
89+
self.sleep_duration = int(config.get("SleepDuration", 10))
90+
9091
exe_file = find_exe(config)
9192
args = [exe_file, cfg_file, "bmi"]
9293

@@ -153,7 +154,7 @@ def finalize(self) -> None:
153154
"""Finalize the model."""
154155
self.process = alive_process(self.process)
155156
self.process.stdin.write(b"finalize\n") # type: ignore
156-
sleep(10)
157+
sleep(self.sleep_duration)
157158
if self.process.poll() != 0:
158159
try:
159160
self.process.terminate()

0 commit comments

Comments
 (0)