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:
358358
359359 for service , command in health_checks :
360360 try :
361+ < << << << HEAD
361362 result = run_ssh_command (ssh , command )
362363 if not result ['succeeded' ]:
363364 logger .warning (f"{ service } not ready" )
364365 logger .error (f"{ service } command failed with rc={ cmd .rc } " )
365366 logger .error (f"{ service } stdout: { cmd .stdout } " )
366367 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 )
367373
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 } " )
372378
373379 # Run detailed checks since we know we have a working connection
374380 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
378382 else :
379383 cmd = check (host )
380384 if cmd .failed is True :
You can’t perform that action at this time.
0 commit comments