feat: enhance redis and production IA

This commit is contained in:
Logan.Li committed 2026-07-07 10:39:33 +08:00
1 parent 644981eef4
commit 58bbc394e9
76 files changed
+1702 -721

No files matched your search

+10 -3
View File
@@ -24,6 +24,13 @@ ensure_dirs() {
mkdir -p "$PID_DIR" "$LOG_DIR"
}
prepare_go_env() {
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
if [ -z "${GOSUMDB:-}" ] || [ "${GOSUMDB:-}" = "off" ]; then
export GOSUMDB=sum.golang.org
fi
}
is_running() {
local pid_file=$1
local name=$2
@@ -79,7 +86,7 @@ start_backend() {
cd "$SCRIPT_DIR/backend"
# 始终重新编译(开发阶段)
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
prepare_go_env
go build -o sql-platform ./cmd/server/
nohup ./sql-platform \
@@ -200,7 +207,7 @@ case "${1:-start}" in
log "=== 构建生产版本 ==="
cd "$SCRIPT_DIR/backend"
log "编译 Go 后端..."
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
prepare_go_env
go build -o sql-platform ./cmd/server/
ok "后端编译完成 → backend/sql-platform"
@@ -213,7 +220,7 @@ case "${1:-start}" in
test|t)
log "=== 运行测试 ==="
cd "$SCRIPT_DIR/backend"
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
prepare_go_env
go test ./... -v "$@"
;;