diff --git a/backend/app/service/monitor.go b/backend/app/service/monitor.go index 320b20134..bd041b896 100644 --- a/backend/app/service/monitor.go +++ b/backend/app/service/monitor.go @@ -148,14 +148,16 @@ func loadNetIO() { if net2.BytesSent != 0 && net1.BytesSent != 0 { itemNet.Up = float64(net2.BytesSent-net1.BytesSent) / 1024 / 60 } - if itemNet.Up > 100000000 { + if itemNet.Up > 10485760 { + itemNet.Up = 0 global.LOG.Errorf("net2: %v, net1: %v, BytesSent: %v \n", net2.BytesSent, net1.BytesSent, float64(net2.BytesSent-net1.BytesSent)/1024/60) } if net2.BytesRecv != 0 && net1.BytesRecv != 0 { itemNet.Down = float64(net2.BytesRecv-net1.BytesRecv) / 1024 / 60 } - if itemNet.Down > 100000000 { + if itemNet.Down > 10485760 { + itemNet.Down = 0 global.LOG.Errorf("net2: %v, net1: %v, BytesRecv: %v \n", net2.BytesRecv, net1.BytesRecv, float64(net2.BytesRecv-net1.BytesRecv)/1024/60) } netList = append(netList, itemNet) diff --git a/backend/app/service/snapshot.go b/backend/app/service/snapshot.go index 09ce7594a..7d75b48f0 100644 --- a/backend/app/service/snapshot.go +++ b/backend/app/service/snapshot.go @@ -57,7 +57,7 @@ func (u *SnapshotService) SnapshotImport(req dto.SnapshotImport) error { return fmt.Errorf("incorrect snapshot request body: %v", req.Names) } for _, snapName := range req.Names { - snap, _ := snapshotRepo.Get(commonRepo.WithByName(snapName)) + snap, _ := snapshotRepo.Get(commonRepo.WithByName(strings.ReplaceAll(snapName, ".tar.gz", ""))) if snap.ID != 0 { return constant.ErrRecordExist }