Update backend readiness check to use TCP port instead of Unix socket

parent 12720b46
......@@ -379,16 +379,7 @@ Examples:
max_wait = 15
for i in range(max_wait):
try:
if is_unix_sockets_supported():
# Check Unix socket
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.settimeout(1)
sock.connect(get_socket_path('worker'))
sock.close()
print("Backend Unix socket is ready!")
break
else:
# Check TCP port
# Check TCP port for worker
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(1)
sock.connect((args.backend_host, args.backend_worker_port))
......@@ -430,16 +421,7 @@ Examples:
max_wait = 15
for i in range(max_wait):
try:
if is_unix_sockets_supported():
# Check Unix socket
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.settimeout(1)
sock.connect(get_socket_path('worker'))
sock.close()
print("Backend Unix socket is ready!")
break
else:
# Check TCP port
# Check TCP port for worker
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(1)
sock.connect((args.backend_host, args.backend_worker_port))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment