From b4076641077d83d227ffa17d2b8080d6873a0a8c Mon Sep 17 00:00:00 2001 From: xjules Date: Mon, 16 Dec 2024 13:25:46 +0100 Subject: [PATCH] Small improvement in client --- src/_ert/forward_model_runner/client.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/_ert/forward_model_runner/client.py b/src/_ert/forward_model_runner/client.py index 1e7dac4b15f..a9db9c7c3e3 100644 --- a/src/_ert/forward_model_runner/client.py +++ b/src/_ert/forward_model_runner/client.py @@ -80,12 +80,9 @@ def __init__( self.context = zmq.asyncio.Context() self.socket = self.context.socket(zmq.DEALER) self.socket.setsockopt(zmq.LINGER, 0) - if dealer_name is None: - self.dealer_id = f"dispatch-{uuid.uuid4().hex[:8]}" - else: - self.dealer_id = dealer_name + self.dealer_id = dealer_name or f"dispatch-{uuid.uuid4().hex[:8]}" self.socket.setsockopt_string(zmq.IDENTITY, self.dealer_id) - print(f"Created: {self.dealer_id=} {token=} {self._ack_timeout=}") + if token is not None: client_public, client_secret = zmq.curve_keypair() self.socket.curve_secretkey = client_secret