执行一般命令时不运行init()中内容

This commit is contained in:
GoEdgeLab
2023-03-10 15:14:14 +08:00
parent b0850b6032
commit 35aa55607e
40 changed files with 148 additions and 15 deletions

View File

@@ -3,12 +3,17 @@
package utils
import (
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
"github.com/shirou/gopsutil/v3/mem"
)
var systemTotalMemory = -1
func init() {
if !teaconst.IsMain {
return
}
_ = SystemMemoryGB()
}