Skip to content

Commit

Permalink
CA-395554 Pacify SonarQube
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <tim.smith@cloud.com>
  • Loading branch information
Tim Smith authored and TimSmithCtx committed Jul 23, 2024
1 parent ab45ca5 commit b2597e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions misc/fairlock/fairlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ def __enter__(self):
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.sock.setblocking(True)
try:
ret = self.sock.connect(self.sockname)
self.sock.connect(self.sockname)
# Merely being connected is not enough. Read a small blob of data.
read = self.sock.recv(10)
self.sock.recv(10)
except (FileNotFoundError, ConnectionRefusedError):
self._ensure_service()
ret = self.sock.connect(self.sockname)
self.sock.connect(self.sockname)
# Merely being connected is not enough. Read a small blob of data.
read = self.sock.recv(10)
self.sock.recv(10)

self.sock.send(f'{os.getpid()} - {time.monotonic()}'.encode())
self.connected = True
Expand Down

0 comments on commit b2597e7

Please sign in to comment.