a
This commit is contained in:
parent
52e849a586
commit
ed5ea8b733
|
|
@ -567,7 +567,12 @@ def _run_supervisorctl(args: list[str]) -> str:
|
|||
out = (res.stdout or "").strip()
|
||||
err = (res.stderr or "").strip()
|
||||
combined = "\n".join([s for s in [out, err] if s]).strip()
|
||||
if res.returncode != 0:
|
||||
# supervisorctl 约定:
|
||||
# - status 在存在 STOPPED/FATAL 等进程时可能返回 exit=3,但输出仍然有效
|
||||
ok_rc = {0}
|
||||
if args and args[0] == "status":
|
||||
ok_rc.add(3)
|
||||
if res.returncode not in ok_rc:
|
||||
raise RuntimeError(combined or f"supervisorctl failed (exit={res.returncode})")
|
||||
return combined or out
|
||||
|
||||
|
|
|
|||
|
|
@ -200,7 +200,11 @@ def run_supervisorctl(args: list[str], timeout_sec: int = 10) -> str:
|
|||
out = (res.stdout or "").strip()
|
||||
err = (res.stderr or "").strip()
|
||||
combined = "\n".join([s for s in [out, err] if s]).strip()
|
||||
if res.returncode != 0:
|
||||
# supervisorctl: status 在存在 STOPPED 等进程时可能返回 exit=3,但输出仍然有效
|
||||
ok_rc = {0}
|
||||
if args and args[0] == "status":
|
||||
ok_rc.add(3)
|
||||
if res.returncode not in ok_rc:
|
||||
raise RuntimeError(combined or f"supervisorctl failed (exit={res.returncode})")
|
||||
return combined or out
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user