From 530fed8ec225453572d57b15c200ab062c335457 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 01 十一月 2023 19:20:21 +0800 Subject: [PATCH] 公海member_id使用0 --- main.go | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index ef7a064..4f29d19 100644 --- a/main.go +++ b/main.go @@ -4,10 +4,10 @@ v1 "aps_crm/api/v1" "aps_crm/conf" "aps_crm/initialize" + "aps_crm/middleware" "aps_crm/model" "aps_crm/pkg/logx" "aps_crm/router" - "aps_crm/service" "fmt" "net/http" "os" @@ -46,8 +46,12 @@ WriteTimeout: 5 * time.Second, } - go v1.InitProductServiceConn() - go service.InitUserConn() + v1.InitProductServiceConn() + middleware.InitUserConn() + v1.InitCodeServiceConn() + + middleware.InitRefreshUserManager(1, 1, 300) //todo zq 鏆傛椂鏀圭煭 + middleware.RunRefreshUser() ///瀹氭椂瀵规椿璺冪敤鎴锋洿鏂扮敤鎴疯鎯� logx.Error(server.ListenAndServe().Error()) } @@ -57,6 +61,11 @@ signal.Notify(quit, syscall.SIGKILL, syscall.SIGQUIT, syscall.SIGINT, syscall.SIGTERM) <-quit - logx.Infof("aps-admin exited...") + middleware.StopRefreshUser() + v1.CloseProductServiceConn() + v1.CloseCodeServiceConn() + middleware.CloseUserConn() + + logx.Infof("aps-crm exited...") os.Exit(0) } -- Gitblit v1.8.0