Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Ubensee <[email protected]>
  • Loading branch information
tkilias and tomuben authored Aug 29, 2023
1 parent 4b787ef commit 9d14a2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _create_receive_socket(self):
self._receive_socket.bind(receive_socket_address)

def try_send(self):
self._logger.debug("resend_if_necessary")
self._logger.debug("try_send")
self._connection_establisher.try_send()

def received_synchronize_connection(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ def run(parameter: PeerCommunicatorTestProcessParameter, queue: BidirectionalQue
context = zmq.Context()
socket_factory = ZMQSocketFactory(context)
socket_factory = FaultInjectionSocketFactory(socket_factory, 0.01, RandomState(parameter.seed))
leader = False
leader_name = "i0"
if parameter.instance_name == leader_name:
leader = True
leader = True if parameter.instance_name == leader_name else False
com = PeerCommunicator(
name=parameter.instance_name,
number_of_peers=parameter.number_of_instances,
Expand All @@ -72,7 +70,7 @@ def run(parameter: PeerCommunicatorTestProcessParameter, queue: BidirectionalQue
try:
queue.put(com.my_connection_info)
peer_connection_infos = queue.get()
if parameter.instance_name == leader_name:
if leader:
for index, connection_info in peer_connection_infos.items():
com.register_peer(connection_info)
finally:
Expand Down

0 comments on commit 9d14a2e

Please sign in to comment.