[ModelicaSystem*] add timeout argument#382
Conversation
ecd996f to
d37ec0b
Compare
adeas31
left a comment
There was a problem hiding this comment.
ModelicaSystemDoE and ModelicaSystem doesn't really need timeout. The timeout is used by OMCSessionZMQ so it is better to expose timeout with API so it can be set to something else other than default 10s.
I also saw that timeout is used very randomly in the code. For starting omc we are using timeout of 2s and then each process class also uses timeout. It is also used for command execution. Perhaps its better to clean up the code and use timeout properly.
|
@adeas31 update the code to: |
181b9a1 to
f9d995c
Compare
|
move point (1) to PR #383; this PR could be applied now the remaining changes should be applied after the modifications of OMCSession as it changes the same code and this means only one (final) rebase |
f9d995c to
cbb6e56
Compare
|
rebased on top of PR #386 |
223c895 to
982f139
Compare
982f139 to
ac0061a
Compare
ac0061a to
252af40
Compare
OMPython/OMCSession.py
Outdated
| time.sleep(self._timeout / 80.0) | ||
| else: | ||
| logger.error(f"Docker did not start. Log-file says:\n{self.get_log()}") | ||
| raise OMCSessionException(f"OMC Server did not start (timeout={self._timeout}).") |
There was a problem hiding this comment.
the code is changed such that the name of the log file is not stored anymore - I will change this such that the log file is reported in the exception
OMPython/OMCSession.py
Outdated
| f"Log-file says:\n{self.get_log()}") | ||
| time.sleep(self._timeout / 80.0) | ||
| else: | ||
| logger.error(f"Docker did not start. Log-file says:\n{self.get_log()}") |
There was a problem hiding this comment.
It is a local server. Not a docker.
There was a problem hiding this comment.
Replace by 'OMC server did not start. Log...'
OMPython/OMCSession.py
Outdated
| time.sleep(self._timeout / 80.0) | ||
| else: | ||
| logger.error(f"Docker did not start. Log-file says:\n{self.get_log()}") | ||
| raise OMCSessionException(f"Docker based OMC Server did not start (timeout={self._timeout}).") |
There was a problem hiding this comment.
Again the log file name is skipped.
There was a problem hiding this comment.
same change as above ...
* remove not needed variable definitions * fix if condition for bool
1e9b435 to
96964d7
Compare
96964d7 to
981f69a
Compare
OMPython/OMCSession.py
Outdated
| time.sleep(self._timeout / 80.0) | ||
| else: | ||
| logger.error(f"Docker did not start. Log-file says:\n{self.get_log()}") | ||
| raise OMCSessionException(f"WSL based OMC Server did not start (timeout={self._timeout}).") |
There was a problem hiding this comment.
This should be Windows subsystem instead of docker, right?
Add / fix argument timeout to / of ModelicaSystem and ModelicaSystemDoE