Skip to content

Commit

Permalink
Remove connected flag from monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Nov 22, 2024
1 parent 070a7c9 commit 78fcccc
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/ert/ensemble_evaluator/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ def __init__(self, ee_con_info: "EvaluatorConnectionInfo") -> None:
async def __aenter__(self) -> "Monitor":
try:
await self.reconnect()
# await asyncio.wait_for(
# self._connected.wait(), timeout=self._connection_timeout
# )

# await self._connected.wait()
except asyncio.TimeoutError as exc:
await self._term()
msg = "Couldn't establish connection with the ensemble evaluator!"
Expand All @@ -65,7 +60,7 @@ async def __aenter__(self) -> "Monitor":
self._receiver_task = asyncio.create_task(self._receiver())
return self

async def _term(self):
async def _term(self) -> None:
if self._receiver_task:
await self._socket.send_multipart([b"", b"DISCONNECT"])
if not self._receiver_task.done():
Expand Down Expand Up @@ -132,7 +127,6 @@ async def track(
self._event_queue.task_done()

async def reconnect(self) -> None:
self._connected.clear()
self._socket.connect(self._ee_con_info.router_uri)
await self._socket.send_multipart([b"", b"CONNECT"])
try:
Expand All @@ -146,7 +140,6 @@ async def reconnect(self) -> None:
f"Failed to get acknowledgment on the monitor {self._id} connect!"
)
raise
self._connected.set()

async def _receiver(self) -> None:
tls: Optional[ssl.SSLContext] = None
Expand Down

0 comments on commit 78fcccc

Please sign in to comment.