main.go
@@ -46,13 +46,12 @@
      WriteTimeout: 5 * time.Second,
   }
   go v1.InitProductServiceConn()
   go middleware.InitUserConn()
   go v1.InitCodeServiceConn()
   v1.InitProductServiceConn()
   middleware.InitUserConn()
   v1.InitCodeServiceConn()
   //c := cron.New()
   //c.AddFunc("@every 15s", service.SyncUserInfo) // 每15秒同步一次
   //c.Start()
   middleware.InitRefreshUserManager(5, 5, 3600)
   middleware.RunRefreshUser() ///定时对活跃用户更新用户详情
   logx.Error(server.ListenAndServe().Error())
}
@@ -62,6 +61,7 @@
   signal.Notify(quit, syscall.SIGKILL, syscall.SIGQUIT, syscall.SIGINT, syscall.SIGTERM)
   <-quit
   middleware.StopRefreshUser()
   v1.CloseProductServiceConn()
   v1.CloseCodeServiceConn()
   middleware.CloseUserConn()