add different polling intervals for ssh and local backends. ssh has a
longer roundtrip
This commit is contained in:
parent
879b7d3fbf
commit
e266530c7d
2 changed files with 4 additions and 1 deletions
|
|
@ -40,6 +40,7 @@ class PersistentShellMixin:
|
||||||
def _cleanup_temp_files(self): ...
|
def _cleanup_temp_files(self): ...
|
||||||
|
|
||||||
_session_id: str = ""
|
_session_id: str = ""
|
||||||
|
_poll_interval: float = 0.01
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _temp_prefix(self) -> str:
|
def _temp_prefix(self) -> str:
|
||||||
|
|
@ -223,7 +224,7 @@ class PersistentShellMixin:
|
||||||
)
|
)
|
||||||
self._send_to_shell(ipc_script)
|
self._send_to_shell(ipc_script)
|
||||||
deadline = time.monotonic() + timeout
|
deadline = time.monotonic() + timeout
|
||||||
poll_interval = 0.15
|
poll_interval = self._poll_interval
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
if is_interrupted():
|
if is_interrupted():
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,8 @@ class SSHEnvironment(PersistentShellMixin, BaseEnvironment):
|
||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
raise RuntimeError(f"SSH connection to {self.user}@{self.host} timed out")
|
raise RuntimeError(f"SSH connection to {self.user}@{self.host} timed out")
|
||||||
|
|
||||||
|
_poll_interval: float = 0.15
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _temp_prefix(self) -> str:
|
def _temp_prefix(self) -> str:
|
||||||
return f"/tmp/hermes-ssh-{self._session_id}"
|
return f"/tmp/hermes-ssh-{self._session_id}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue