refactor(service): 重构服务代码结构并更新配置

This commit is contained in:
2026-05-18 19:19:16 +08:00
parent 09290fecbe
commit 142fea1e91
6 changed files with 27 additions and 26 deletions

View File

@@ -33,14 +33,14 @@ func main() {
// 本地调试:可选自动触发 worker/cleaner由配置文件控制
startAutoRunner(ctx)
// 监听退出信号,确保 Ctrl+C 能完整退出(停止 worker/cleaner 并关闭 http server
// 监听退出信号,确保 Ctrl+C 能完整退出(停止 worker/cleaner 并关闭 gateway server
quit := make(chan os.Signal, 1)
signal.Notify(quit, os.Interrupt, syscall.SIGTERM)
<-quit
g.Log().Infof(ctx, "[main] 收到退出信号,开始优雅退出...")
cancel()
// 关闭 http serverRouteRegister 内部是 go Httpserver.Run() 启动的)
// 关闭 gateway serverRouteRegister 内部是 go Httpserver.Run() 启动的)
_ = http.Httpserver.Shutdown()
}