diff options
| author | Jeff Carr <[email protected]> | 2024-01-15 19:00:41 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-15 19:00:41 -0600 |
| commit | 94aa368cff322e667156571638a45bd3117a2739 (patch) | |
| tree | 2fdeaf202d9a6f367306d790bc97b610e99c7cc0 /linuxstatus/update.go | |
| parent | d0fe8be3709f170bdc2858708d6eaa6b7e4bf9de (diff) | |
garbage collect after cleaning to retain history
Diffstat (limited to 'linuxstatus/update.go')
| -rw-r--r-- | linuxstatus/update.go | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/linuxstatus/update.go b/linuxstatus/update.go deleted file mode 100644 index b304370..0000000 --- a/linuxstatus/update.go +++ /dev/null @@ -1,40 +0,0 @@ -package linuxstatus - -import ( - "fmt" - "time" - "errors" - - "go.wit.com/log" -) - -func (ls *LinuxStatus) Update() { - if ! ls.Ready() { - log.Log(WARN, "can't update yet. ready is false") - log.Error(errors.New("Update() is not ready yet")) - return - } - log.Log(INFO, "Update() START") - duration := timeFunction(func () { - linuxLoop() - }) - ls.setSpeed(duration) - log.Log(INFO, "Update() END") -} - -func (ls *LinuxStatus) setSpeed(duration time.Duration) { - s := fmt.Sprint(duration) - if ls.speedActual == nil { - log.Log(WARN, "can't actually warn") - return - } - ls.speedActual.Set(s) - - if (duration > 500 * time.Millisecond ) { - ls.speed.Set("SLOW") - } else if (duration > 100 * time.Millisecond ) { - ls.speed.Set("OK") - } else { - ls.speed.Set("FAST") - } -} |
