fix: loadTrades before chart init + try-catch for CDN failure
- Reorder init(): loadTrades() runs first, charts second - Wrap chart init in try-catch so UI survives CDN issues - Update start.sh to detect changes in embedded .html/.js/.css
This commit is contained in:
@@ -29,8 +29,9 @@ if ss -tlnp 2>/dev/null | grep -q ":$PORT "; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 编译(如果源码有变更)
|
||||
if [ ! -x "$BIN" ] || [ "$(find . -name '*.go' -newer "$BIN" 2>/dev/null | head -1)" ]; then
|
||||
# 编译(如果源码或嵌入文件有变更)
|
||||
WEB_FILES=$(find web/static -name '*.html' -o -name '*.js' -o -name '*.css' 2>/dev/null)
|
||||
if [ ! -x "$BIN" ] || [ -n "$(find . -name '*.go' $WEB_FILES -newer "$BIN" 2>/dev/null | head -1)" ]; then
|
||||
echo "[start] 编译新二进制..."
|
||||
go build -o "$BIN" . 2>&1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user