zhangqian
2023-12-18 ed3d45b189f102249eabd0cb5a0299bc66b0dea6
main.go
@@ -11,14 +11,12 @@
   "syscall"
   "time"
   "wms/conf"
   "wms/controllers"
   "wms/models"
   "wms/pkg/logx"
   "wms/proto/client"
   "wms/proto/init_client"
   "wms/proto/inventory_order"
   "wms/proto/product_inventory"
   "wms/proto/purchase_wms"
   "wms/proto/supplier"
   "wms/router"
   "wms/service"
)
@@ -49,11 +47,12 @@
   }
   go shutdown(server)
   //启动grpc客户端
   go controllers.InitInventoryOrderServiceConn()
   go controllers.InitProductInventoryServiceConn()
   go controllers.InitCodeServiceConn()
   go supplier.InitConn()
   go client.InitConn()
   //go controllers.InitInventoryOrderServiceConn()
   //go controllers.InitProductInventoryServiceConn()
   //go controllers.InitCodeServiceConn()
   //go supplier.InitConn()
   //go client.InitConn()
   go init_client.InitClient()
   //启动grpc服务
   go func() {
      ln, err := net.Listen("tcp", ":"+conf.WebConf.GrpcPort)
@@ -90,11 +89,12 @@
   ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
   defer cancel()
   controllers.CloseInventoryOrderServiceConn()
   controllers.CloseProductInventoryServiceConn()
   controllers.CloseCodeServiceConn()
   supplier.CloseConn()
   client.CloseConn()
   //controllers.CloseInventoryOrderServiceConn()
   //controllers.CloseProductInventoryServiceConn()
   //controllers.CloseCodeServiceConn()
   //supplier.CloseConn()
   //client.CloseConn()
   init_client.CloseClient()
   // 关闭HTTP服务器
   if err := server.Shutdown(ctx); err != nil {
      logx.Infof("服务优雅退出失败: %v", err)