Skip to content

Commit

Permalink
AHRSLogger logs only if disk usage < 95%.
Browse files Browse the repository at this point in the history
  • Loading branch information
westphae committed Mar 6, 2017
1 parent 5667c1a commit 3e43c1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main/gen_gdl90.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion main/sensors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3e43c1f

Please sign in to comment.