fix(lastleg): register shipping mapper on startup
This commit is contained in:
@@ -222,11 +222,27 @@ local_health_state() {
|
||||
docker inspect --format '{{if .State.Health}}{{.State.Health.Status}}{{else}}no-health:{{.State.Status}}{{end}}' "$container_id" 2>/dev/null || echo missing
|
||||
}
|
||||
|
||||
local_runtime_state() {
|
||||
container_id="$(local_container_id)"
|
||||
if [ -z "$container_id" ]; then
|
||||
echo missing
|
||||
return
|
||||
fi
|
||||
docker inspect --format '{{.State.Status}}' "$container_id" 2>/dev/null || echo missing
|
||||
}
|
||||
|
||||
wait_for_local_health() {
|
||||
elapsed=0
|
||||
while [ "$elapsed" -lt "$HEALTH_TIMEOUT_SECONDS" ]; do
|
||||
runtime_state="$(local_runtime_state)"
|
||||
health_state="$(local_health_state)"
|
||||
echo "容器健康状态: $health_state(已等待 ${elapsed}s)"
|
||||
echo "容器运行状态: $runtime_state,健康状态: $health_state(已等待 ${elapsed}s)"
|
||||
case "$runtime_state" in
|
||||
restarting|exited|dead)
|
||||
echo "容器未保持运行,立即停止等待: $runtime_state" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
case "$health_state" in
|
||||
healthy)
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user