From 0409a5d0235f4a87ecf08b12baa9149279a90447 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期五, 18 八月 2023 22:25:58 +0800
Subject: [PATCH] fix

---
 main.go |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/main.go b/main.go
index 29b0377..35a40b7 100644
--- a/main.go
+++ b/main.go
@@ -1,12 +1,15 @@
 package main
 
 import (
+	v1 "aps_crm/api/v1"
 	"aps_crm/conf"
 	"aps_crm/initialize"
 	"aps_crm/model"
 	"aps_crm/pkg/logx"
 	"aps_crm/router"
+	"aps_crm/service"
 	"fmt"
+	"github.com/robfig/cron/v3"
 	"net/http"
 	"os"
 	"os/signal"
@@ -43,6 +46,14 @@
 		ReadTimeout:  5 * time.Second,
 		WriteTimeout: 5 * time.Second,
 	}
+
+	go v1.InitProductServiceConn()
+	go service.InitUserConn()
+
+	c := cron.New()
+	c.AddFunc("@every 15s", service.SyncUserInfo) // 姣�15绉掑悓姝ヤ竴娆�
+	c.Start()
+
 	logx.Error(server.ListenAndServe().Error())
 }
 
@@ -51,6 +62,9 @@
 	signal.Notify(quit, syscall.SIGKILL, syscall.SIGQUIT, syscall.SIGINT, syscall.SIGTERM)
 	<-quit
 
-	logx.Infof("aps-admin exited...")
+	v1.CloseProductServiceConn()
+	service.CloseUserConn()
+
+	logx.Infof("aps-crm exited...")
 	os.Exit(0)
 }

--
Gitblit v1.8.0