From 3e43c1f69e2f383269b887c3885ac1e023094807 Mon Sep 17 00:00:00 2001 From: Eric Westphal Date: Sun, 5 Mar 2017 19:07:01 -0500 Subject: [PATCH] AHRSLogger logs only if disk usage < 95%. --- main/gen_gdl90.go | 2 +- main/sensors.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main/gen_gdl90.go b/main/gen_gdl90.go index 56aad526e..83591cc8e 100644 --- a/main/gen_gdl90.go +++ b/main/gen_gdl90.go @@ -1224,7 +1224,7 @@ func printStats() { log.Printf(" - Last BMP read: %s\n", stratuxClock.HumanizeTime(mySituation.LastTempPressTime)) } // Check if we're using more than 95% of the free space. If so, throw a warning (only once). - if !diskUsageWarning && usage.Usage() > 95.0 { + if !diskUsageWarning && usage.Usage() > 0.95 { err_p := fmt.Errorf("Disk bytes used = %s (%.1f %%), Disk bytes free = %s (%.1f %%)", humanize.Bytes(usage.Used()), 100*usage.Usage(), humanize.Bytes(usage.Free()), 100*(1-usage.Usage())) addSystemError(err_p) diskUsageWarning = true diff --git a/main/sensors.go b/main/sensors.go index 85d2e8189..6b23a53be 100644 --- a/main/sensors.go +++ b/main/sensors.go @@ -280,7 +280,7 @@ func sensorAttitudeSender() { analysisLogger = ahrs.NewAHRSLogger(analysisFilename, s.GetLogMap()) } - if analysisLogger != nil { + if analysisLogger != nil && usage.Usage() < 0.95 { analysisLogger.Log() } } else {