From ebbe3443a19a12328eb60967079de2007f8d4f04 Mon Sep 17 00:00:00 2001 From: UUBulb <35923940+uubulb@users.noreply.github.com> Date: Tue, 26 Nov 2024 22:45:55 +0800 Subject: [PATCH] fix: unused gpu option (#101) --- pkg/monitor/monitor.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/monitor/monitor.go b/pkg/monitor/monitor.go index c5266a2e..aa37fd9f 100644 --- a/pkg/monitor/monitor.go +++ b/pkg/monitor/monitor.go @@ -172,7 +172,9 @@ func GetState(skipConnectionCount bool, skipProcsCount bool) *model.HostState { ret.Temperatures = temperatureStat } - ret.GPU = tryStat(context.Background(), GPU, gpu.GetState) + if agentConfig.GPU { + ret.GPU = tryStat(context.Background(), GPU, gpu.GetState) + } ret.NetInTransfer, ret.NetOutTransfer = netInTransfer, netOutTransfer ret.NetInSpeed, ret.NetOutSpeed = netInSpeed, netOutSpeed