zhangqian
2023-11-24 313617ceb05dd5194d2091c717a25cbf33ef39b9
main.go
@@ -14,8 +14,10 @@
   "wms/controllers"
   "wms/models"
   "wms/pkg/logx"
   "wms/proto/client"
   "wms/proto/product_inventory"
   "wms/proto/purchase_wms"
   "wms/proto/supplier"
   "wms/router"
   "wms/service"
)
@@ -49,6 +51,8 @@
   go controllers.InitInventoryOrderServiceConn()
   go controllers.InitProductInventoryServiceConn()
   go controllers.InitCodeServiceConn()
   go supplier.InitConn()
   go client.InitConn()
   //启动grpc服务
   go func() {
      ln, err := net.Listen("tcp", ":"+conf.WebConf.GrpcPort)
@@ -69,6 +73,7 @@
   }()
   go service.InitLocationReportData()
   go service.InitHistoryReportData()
   logx.Error(server.ListenAndServe().Error())
}
@@ -86,6 +91,8 @@
   controllers.CloseInventoryOrderServiceConn()
   controllers.CloseProductInventoryServiceConn()
   controllers.CloseCodeServiceConn()
   supplier.CloseConn()
   client.CloseConn()
   // 关闭HTTP服务器
   if err := server.Shutdown(ctx); err != nil {
      logx.Infof("服务优雅退出失败: %v", err)