| | |
| | | "aps_crm/model" |
| | | "aps_crm/pkg/logx" |
| | | "aps_crm/router" |
| | | "aps_crm/service" |
| | | "fmt" |
| | | "github.com/robfig/cron/v3" |
| | | "net/http" |
| | | "os" |
| | | "os/signal" |
| | |
| | | } |
| | | |
| | | go v1.InitProductServiceConn() |
| | | go service.InitUserConn() |
| | | |
| | | c := cron.New() |
| | | c.AddFunc("@every 15s", service.SyncUserInfo) // 每15秒同步一次 |
| | | c.Start() |
| | | |
| | | logx.Error(server.ListenAndServe().Error()) |
| | | } |
| | |
| | | signal.Notify(quit, syscall.SIGKILL, syscall.SIGQUIT, syscall.SIGINT, syscall.SIGTERM) |
| | | <-quit |
| | | |
| | | v1.CloseProductServiceConn() |
| | | service.CloseUserConn() |
| | | |
| | | logx.Infof("aps-admin exited...") |
| | | os.Exit(0) |
| | | } |