mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-05-25 23:14:01 +00:00
Fix manage.sh references to Node.js for Go backend
Changed all 'Node.js' references to generic 'Server' in: - verify_health() - health check messages - show_container_status() - stats display comment - cmd_status() - service health output The Go backend runs behind Caddy just like the Node version did, so the health checks via docker exec localhost:3000 remain correct. Only the messaging needed updating. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -153,7 +153,7 @@ verify_health() {
|
||||
fi
|
||||
|
||||
# Wait for /api/stats response
|
||||
info "Waiting for Node.js to respond..."
|
||||
info "Waiting for server to respond..."
|
||||
local healthy=false
|
||||
for i in $(seq 1 10); do
|
||||
if docker exec "$CONTAINER_NAME" wget -qO- http://localhost:3000/api/stats &>/dev/null; then
|
||||
@@ -164,11 +164,11 @@ verify_health() {
|
||||
done
|
||||
|
||||
if ! $healthy; then
|
||||
err "Node.js did not respond after 20 seconds."
|
||||
err "Server did not respond after 20 seconds."
|
||||
warn "Check logs: ./manage.sh logs"
|
||||
return 1
|
||||
fi
|
||||
log "Node.js is responding."
|
||||
log "Server is responding."
|
||||
|
||||
# Check for MQTT errors in recent logs
|
||||
local mqtt_errors
|
||||
@@ -675,7 +675,7 @@ show_container_status() {
|
||||
log "${LABEL} (${NAME}): Running — Health: ${health}"
|
||||
docker ps --filter "name=${NAME}" --format " Ports: {{.Ports}}"
|
||||
|
||||
# Node.js stats
|
||||
# Server stats
|
||||
if docker exec "$NAME" wget -qO /dev/null http://localhost:3000/api/stats 2>/dev/null; then
|
||||
local stats packets nodes
|
||||
stats=$(docker exec "$NAME" wget -qO- http://localhost:3000/api/stats 2>/dev/null)
|
||||
@@ -735,14 +735,14 @@ cmd_status() {
|
||||
echo ""
|
||||
|
||||
info "Service health:"
|
||||
# Node.js
|
||||
# Server
|
||||
if docker exec "$CONTAINER_NAME" wget -qO /dev/null http://localhost:3000/api/stats 2>/dev/null; then
|
||||
STATS=$(docker exec "$CONTAINER_NAME" wget -qO- http://localhost:3000/api/stats 2>/dev/null)
|
||||
PACKETS=$(echo "$STATS" | grep -oP '"totalPackets":\K[0-9]+' 2>/dev/null || echo "?")
|
||||
NODES=$(echo "$STATS" | grep -oP '"totalNodes":\K[0-9]+' 2>/dev/null || echo "?")
|
||||
log " Node.js — ${PACKETS} packets, ${NODES} nodes"
|
||||
log " Server — ${PACKETS} packets, ${NODES} nodes"
|
||||
else
|
||||
err " Node.js — not responding"
|
||||
err " Server — not responding"
|
||||
fi
|
||||
|
||||
# Mosquitto
|
||||
|
||||
Reference in New Issue
Block a user