This commit is contained in:
+8
-1
@@ -16,7 +16,14 @@ db_params = {
|
||||
'port': int(env.get('DB_PORT'))
|
||||
}
|
||||
|
||||
db = psql.connect(**db_params)
|
||||
db = None
|
||||
|
||||
for _ in range(5):
|
||||
try:
|
||||
db = psql.connect(**db_params)
|
||||
except Exception as e:
|
||||
print(f"Failed to connect ({e}), retrying...")
|
||||
time.sleep(5)
|
||||
|
||||
class PassQueue:
|
||||
def __init__(self):
|
||||
|
||||
Reference in New Issue
Block a user