fix: possible cause of nchan memory leak - version 2

This commit is contained in:
Tom Mortensen
2025-02-04 14:28:24 -08:00
parent 614b018d72
commit ef5ebd8683

View File

@@ -1,5 +1,13 @@
#!/bin/bash
while :; do
curl -sfd "$(docker stats --no-stream --format='{{.ID}};{{.CPUPerc}};{{.MemUsage}}')" --unix-socket /var/run/nginx.socket http://localhost/pub/dockerload?buffer_length=0 >/dev/null 2>&1
sleep 1 # prevent fast loop if above returns immediately
output=$(docker stats --no-stream --format='{{.ID}};{{.CPUPerc}};{{.MemUsage}}' 2>&1)
if [[ $? -ne 0 ]]; then
logger -t webgui "docker stats error: $output"
exit 1
fi
if [[ -n "$output" ]]; then
curl -sfd "$output" --unix-socket /var/run/nginx.socket http://localhost/pub/dockerload?buffer_length=1 >/dev/null 2>&1
fi
sleep 1
done