From e4525fb1175f4960b1dcc3f412f91e4450f1f656 Mon Sep 17 00:00:00 2001 From: zhenorzz Date: Fri, 29 Apr 2022 10:27:53 +0800 Subject: [PATCH] A 1.3.1 --- task/Task.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/task/Task.go b/task/Task.go index 30e4026..5a8a710 100644 --- a/task/Task.go +++ b/task/Task.go @@ -199,7 +199,6 @@ func obRAMUsage() { } total := 0.0 free := 0.0 - available := 0.0 for i, line := range strings.Split(utils.ClearNewline(stdout.String()), "\n") { fields := strings.Fields(line) if i == 0 { @@ -215,15 +214,11 @@ func obRAMUsage() { } else if i == 2 && fields[0] == "MemAvailable:" { val, err := strconv.ParseFloat(fields[1], 64) if err == nil { - available += val // tally up all the numbers to get total ticks + free += val // tally up all the numbers to get total ticks } } } - if available > 0 { - free = available - } - ramUsage := 100 * (total - free) / total agent := model.Agent{ Type: model.TypeRAM,