Skip to content

Commit

Permalink
Ruff on evaluator
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Dec 10, 2024
1 parent 8b9a9ab commit 6a86a2e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/ert/ensemble_evaluator/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
Any,
Awaitable,
Callable,
Dict,
Generator,
Iterable,
List,
Sequence,
Expand Down Expand Up @@ -275,11 +273,11 @@ async def forward_checksum(self, event: Event) -> None:
await self._manifest_queue.put(event)

async def _server(self) -> None:
_zmq_context = zmq.asyncio.Context()
zmq_context = zmq.asyncio.Context()
try:
print("INIT ZMQ ...")
# Create and configure the ROUTER socket
self._router_socket: zmq.asyncio.Socket = _zmq_context.socket(zmq.ROUTER)
self._router_socket: zmq.asyncio.Socket = zmq_context.socket(zmq.ROUTER)
self._router_socket.setsockopt(zmq.LINGER, 0)
if self._config.server_public_key and self._config.server_secret_key:
self._router_socket.curve_secretkey = self._config.server_secret_key
Expand Down Expand Up @@ -322,7 +320,7 @@ async def _server(self) -> None:
finally:
try:
self._router_socket.close()
_zmq_context.destroy()
zmq_context.destroy()
except Exception as exc:
logger.warning(f"Failed to clean up zmq context {exc}")
logger.info("ZMQ cleanup done!")
Expand Down

0 comments on commit 6a86a2e

Please sign in to comment.