14 lines
252 B
Python
14 lines
252 B
Python
import socket
|
|
import time
|
|
import os
|
|
|
|
port = 5432
|
|
|
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
while True:
|
|
try:
|
|
s.connect(('postgres-db', port))
|
|
s.close()
|
|
break
|
|
except socket.error as ex:
|
|
time.sleep(0.1) |