1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-28 02:02:02 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-01-29 15:19:05 +08:00
parent 2f84ef4c0e
commit 727de55818

View File

@ -31,7 +31,7 @@ func _runtime_init(m *ice.Message) {
m.Conf(RUNTIME, kit.Keys(HOST, MAXPROCS), runtime.GOMAXPROCS(0))
nfs.Exists(m, "/proc/meminfo", func(p string) {
kit.For(kit.SplitLine(m.Cmdx(nfs.CAT, p)), func(p string) {
switch ls := kit.Split(p, ": "); ls[0] {
switch ls := kit.Split(p, ": "); kit.Select("", ls, 0) {
case "MemTotal", "MemFree", "MemAvailable", "Buffers", "Cached":
m.Conf(RUNTIME, kit.Keys(HOST, ls[0]), kit.FmtSize(kit.Int(ls[1])*1024))
}