Fix calculating uptime after system sleep (#4332)
* Fix calculating uptime after system sleep * Update internal/clientcache/internal/daemon/status_handler.go Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> --------- Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
This commit is contained in:
1 parent
ea1ec7a1a3
commit
d6c9db968a
1 file changed
+4
-1
@@ -123,7 +123,10 @@ func toApiStatus(in *cache.Status, started time.Time, socketAddr, logLocation st
|
||||
}
|
||||
|
||||
out := &StatusResult{
|
||||
Uptime: time.Since(started),
|
||||
// Round(0) strips the monotonic clock from results which can drift
|
||||
// by a wide degree from the wall clock in the case where the system
|
||||
// sleeps.
|
||||
Uptime: time.Since(started.Round(0)),
|
||||
SocketAddress: socketAddr,
|
||||
Version: version.Get().FullVersionNumber(true),
|
||||
LogLocation: logLocation,
|
||||
|
||||
Reference in new issue
Block a user