From fa62c65526bad10426756b988e32941cf5bd4e47 Mon Sep 17 00:00:00 2001 From: LinkLeong Date: Mon, 11 Sep 2023 09:39:50 +0100 Subject: [PATCH] add amd cpu suport --- route/init.go | 2 +- service/system.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/route/init.go b/route/init.go index 70d2628..e90f895 100644 --- a/route/init.go +++ b/route/init.go @@ -33,7 +33,7 @@ import ( func InitFunction() { go InitNetworkMount() go InitInfo() - go InitZerotier() + //go InitZerotier() } func InitInfo() { diff --git a/service/system.go b/service/system.go index e307a4b..a830c42 100644 --- a/service/system.go +++ b/service/system.go @@ -473,6 +473,7 @@ func GetCPUThermalZone() string { break } } + Cache.SetDefault(keyName, path) return path } @@ -483,7 +484,10 @@ func (s *systemService) GetCPUTemperature() int { if len(path) > 0 { outPut = string(file.ReadFullFile(path + "/temp")) } else { - outPut = "0" + outPut = string(file.ReadFullFile("/sys/class/hwmon/hwmon0/temp1_input")) + if len(outPut) == 0 { + outPut = "0" + } } celsius, _ := strconv.Atoi(strings.TrimSpace(outPut))