为 UserHost/CustomerHost/ChessGameHost/FishRoomHost 补回 swagger;修正服务器替换脚本的网关健康检查
This commit is contained in:
@@ -86,10 +86,15 @@ run_container() {
|
||||
}
|
||||
|
||||
health() {
|
||||
local hp; hp=$(host_port "$1")
|
||||
local svc=$1 hp; hp=$(host_port "$svc")
|
||||
for _ in $(seq 1 15); do
|
||||
local c; c=$(curl -s -o /dev/null -w '%{http_code}' "http://127.0.0.1:$hp/health")
|
||||
[ "$c" = "200" ] && return 0
|
||||
if [ "$svc" = "gateway" ]; then
|
||||
# 网关的 /health 被 Ocelot 接管,会返回 404;只要端口有 HTTP 响应即视为存活
|
||||
[ "$c" != "000" ] && return 0
|
||||
else
|
||||
[ "$c" = "200" ] && return 0
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user