diff --git a/catfish/worker/server.py b/catfish/worker/server.py index 37b3af0..8d7c776 100644 --- a/catfish/worker/server.py +++ b/catfish/worker/server.py @@ -22,13 +22,7 @@ WORKER_SERVER_SOCKET = os.path.join(BASE_SOCKET_DIR, "catfish.sock") def send_to_server(payload): with socket.socket(socket.AF_UNIX, type=socket.SOCK_STREAM) as sock: - while True: - try: - sock.connect(WORKER_SERVER_SOCKET) - break - except ConnectionRefusedError: - time.sleep(0.1) - + sock.connect(WORKER_SERVER_SOCKET) sock.sendall(ujson.dumps(payload).encode() + NEW_LINE) return read_all_from_socket(sock)