jiangshuai
2023-11-23 c9cedfb740614a995576171df73f19ebd613aff0
main.go
@@ -16,7 +16,9 @@
   "wms/pkg/logx"
   "wms/proto/product_inventory"
   "wms/proto/purchase_wms"
   "wms/proto/supplier"
   "wms/router"
   "wms/service"
)
func main() {
@@ -48,6 +50,7 @@
   go controllers.InitInventoryOrderServiceConn()
   go controllers.InitProductInventoryServiceConn()
   go controllers.InitCodeServiceConn()
   go supplier.InitConn()
   //启动grpc服务
   go func() {
      ln, err := net.Listen("tcp", ":"+conf.WebConf.GrpcPort)
@@ -66,6 +69,10 @@
         panic(fmt.Sprintf("grpc server init error: %v", err.Error()))
      }
   }()
   go service.InitLocationReportData()
   go service.InitHistoryReportData()
   logx.Error(server.ListenAndServe().Error())
}
@@ -82,6 +89,7 @@
   controllers.CloseInventoryOrderServiceConn()
   controllers.CloseProductInventoryServiceConn()
   controllers.CloseCodeServiceConn()
   supplier.CloseConn()
   // 关闭HTTP服务器
   if err := server.Shutdown(ctx); err != nil {
      logx.Infof("服务优雅退出失败: %v", err)