This commit is contained in:
vet
2026-04-14 12:02:15 +07:00
parent 11561c9775
commit bb4c3273ca
2 changed files with 25 additions and 0 deletions

View File

@@ -297,3 +297,25 @@ pc_probe_msg_gateway() {
info " MsgGateway Nginx 入口: ${o}/msg_gateway不做无 token HTTP 探测,避免在 openim-server.log 中产生 token is empty 告警)"
}
pc_check_wasm_assets() {
local origin="${1:-}"
origin="${origin%/}"
[[ -z "$origin" ]] && return 0
if ! command -v curl &>/dev/null; then
warn " 未安装 curl跳过 PC WASM 资源检查"
return 0
fi
local asset url ct
for asset in openIM.wasm sql-wasm.wasm wasm_exec.js; do
url="${origin}/${asset}"
if curl -fsS --max-time 5 "$url" >/dev/null 2>&1; then
ct=$(curl -fsSI --max-time 5 "$url" 2>/dev/null | awk 'BEGIN{IGNORECASE=1} /^content-type:/ {sub(/\r$/, ""); print $0; exit}' || true)
success " PC SDK 资源可达: ${url}${ct:+ (${ct#*: })}"
else
warn " PC SDK 资源不可达: ${url}SDK login 可能卡住且不会发起 /msg_gateway WebSocket"
fi
done
}