From 0bf98904edfb13d22f7ce72c440adf45229dba41 Mon Sep 17 00:00:00 2001 From: uubulb Date: Thu, 16 Jan 2025 21:16:24 +0800 Subject: [PATCH] fix #158 --- pkg/monitor/monitor.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/monitor/monitor.go b/pkg/monitor/monitor.go index 82f52de..7d97cf4 100644 --- a/pkg/monitor/monitor.go +++ b/pkg/monitor/monitor.go @@ -89,6 +89,7 @@ func GetHost() *model.Host { ret.PlatformVersion = hi.PlatformVersion ret.Arch = hi.KernelArch ret.BootTime = hi.BootTime + cachedBootTime = time.Unix(int64(hi.BootTime), 0) } ctxCpu := context.WithValue(context.Background(), cpu.CPUHostKey, cpuType) @@ -119,8 +120,6 @@ func GetHost() *model.Host { } } - cachedBootTime = time.Unix(int64(hi.BootTime), 0) - ret.Version = Version return &ret