重命名客户端相关术语为节点;移动 utils 包到根路径;优化网关对节点各种连接状态的处理,并在节点断联后统一清理资源

This commit is contained in:
2025-05-17 10:00:28 +08:00
parent 20ac7dbd91
commit 84e01d3b50
14 changed files with 150 additions and 129 deletions

View File

@@ -15,7 +15,7 @@ import (
"proxy-server/gateway/log"
"proxy-server/gateway/report"
"proxy-server/gateway/web"
"proxy-server/pkg/utils"
"proxy-server/utils"
"sync"
"time"
@@ -88,7 +88,7 @@ func (s *server) Run() (err error) {
// }()
// 报告上线
slog.Debug("报告服务上线")
slog.Info("报告服务上线")
err = report.Online(app.Name)
if err != nil {
return fmt.Errorf("服务上线失败: %w", err)
@@ -125,11 +125,11 @@ func (s *server) Run() (err error) {
// 等待其它服务关闭
select {
case <-utils.WgWait(&wg):
slog.Info("服务正常关闭")
case <-time.After(time.Duration(env.AppExitTimeout) * time.Second):
slog.Warn("超时强制关闭")
}
slog.Info("服务已退出")
return nil
}