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 |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/main.go b/main.go
index 98b7547..4f29d19 100644
--- a/main.go
+++ b/main.go
@@ -4,6 +4,7 @@
 	v1 "aps_crm/api/v1"
 	"aps_crm/conf"
 	"aps_crm/initialize"
+	"aps_crm/middleware"
 	"aps_crm/model"
 	"aps_crm/pkg/logx"
 	"aps_crm/router"
@@ -45,7 +46,12 @@
 		WriteTimeout: 5 * time.Second,
 	}
 
-	go v1.InitProductServiceConn()
+	v1.InitProductServiceConn()
+	middleware.InitUserConn()
+	v1.InitCodeServiceConn()
+
+	middleware.InitRefreshUserManager(1, 1, 300) //todo zq 鏆傛椂鏀圭煭
+	middleware.RunRefreshUser()                  ///瀹氭椂瀵规椿璺冪敤鎴锋洿鏂扮敤鎴疯鎯�
 
 	logx.Error(server.ListenAndServe().Error())
 }
@@ -55,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