Commit c6e6375b authored by xuezj's avatar xuezj

就绪状态调试

parent dabe633c
...@@ -3,34 +3,25 @@ ...@@ -3,34 +3,25 @@
# 就绪检查, 返回0表示就绪 # 就绪检查, 返回0表示就绪
# 请求tech/health/check # 请求tech/health/check
# status 返回5xx 启动中(未就绪) # status 返回5xx or 000 启动中(未就绪)
# 返回404 未实现该接口,认为就绪 # 返回404 未实现该接口,认为就绪
# 返回2xx, 就绪 # 返回2xx, 就绪
# 其他, 就绪
statusCode=`curl -I -o /dev/null -s -w %{http_code} http://localhost/tech/health/check` statusCode=`curl -I -o /dev/null -s -w %{http_code} http://localhost/tech/health/check`
echo "statusCode: ${statusCode}" >> log.txt echo "statusCode: ${statusCode}"
statusCodeFirst="${statusCode:0:1}" statusCodeFirst="${statusCode:0:1}"
echo "statusCodeFirst: ${statusCodeFirst}" >> log.txt echo "statusCodeFirst: ${statusCodeFirst}"
READY=0 READY=0
UNREADY=1 UNREADY=1
if [ ${statusCodeFirst} = "5" ] if [ ${statusCodeFirst} = "5" -o ${statusCodeFirst} = "0" ]
then then
exit ${UNREADY} exit ${UNREADY}
fi fi
if [ ${statusCode} = "404" ]
then
exit ${UNREADY}
fi
if [ ${statusCodeFirst} = "2" ]
then
exit ${READY}
fi
exit ${READY} exit ${READY}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment