This commit is contained in:
孟帅
2023-05-10 23:54:50 +08:00
parent bbe655a4d8
commit 49a96750bf
314 changed files with 15138 additions and 6244 deletions

View File

@@ -35,19 +35,10 @@ func init() {
func (s *sAdminMonitor) StartMonitor(ctx context.Context) {
simple.SafeGo(ctx, func(ctx context.Context) {
s.data.STartTime = gtime.Now().Timestamp()
intranetIP, err := location.GetLocalIP()
if err != nil {
g.Log().Infof(ctx, "parse intranetIP err:%+v", err)
}
s.data.IntranetIP = intranetIP
s.data.IntranetIP, _ = location.GetLocalIP()
s.data.PublicIP, _ = location.GetPublicIP(ctx)
publicIP, err := location.GetPublicIP(ctx)
if err != nil {
g.Log().Infof(ctx, "parse publicIP err:%+v", err)
}
s.data.PublicIP = publicIP
_, err = gcron.Add(ctx, "@every 1s", func(ctx context.Context) {
_, err := gcron.Add(ctx, "@every 1s", func(ctx context.Context) {
s.Lock()
defer s.Unlock()
s.netIO()