File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -358,23 +358,27 @@ def is_healthy(ssh) -> bool:
358
358
359
359
for service , command in health_checks :
360
360
try :
361
+ < << << << HEAD
361
362
result = run_ssh_command (ssh , command )
362
363
if not result ['succeeded' ]:
363
364
logger .warning (f"{ service } not ready" )
364
365
logger .error (f"{ service } command failed with rc={ cmd .rc } " )
365
366
logger .error (f"{ service } stdout: { cmd .stdout } " )
366
367
logger .error (f"{ service } stderr: { cmd .stderr } " )
368
+ == == == =
369
+ if service == "postgres" :
370
+ # For PostgreSQL, we need to check multiple things
371
+ pg_isready = check (host )
372
+ > >> >> >> 65 ef0692 (test : do not unpack result )
367
373
368
- if systemd_status .failed :
369
- logger .error ("PostgreSQL systemd service is not active " )
370
- logger .error (f"systemd status : { systemd_status .stdout } " )
371
- logger .error (f"systemd error : { systemd_status .stderr } " )
374
+ if pg_isready .failed :
375
+ logger .error ("PostgreSQL is not ready " )
376
+ logger .error (f"pg_isready stdout : { pg_isready .stdout } " )
377
+ logger .error (f"pg_isready stderr : { pg_isready .stderr } " )
372
378
373
379
# Run detailed checks since we know we have a working connection
374
380
run_detailed_checks (host )
375
-
376
- if any (cmd .failed for cmd in [systemd_status , socket_check , pg_isready ]):
377
- return False
381
+ return False
378
382
else :
379
383
cmd = check (host )
380
384
if cmd .failed is True :
You can’t perform that action at this time.
0 commit comments