[host] add RefreshBootTimeCache function

This commit adds the RefreshBootTimeCache function, allowing users to
manually refresh the cached boot time if they are using the
`enableBootTimeCache` feature.
pull/1616/head
braydonk 1 year ago
parent 642e1d7e92
commit f6350ce475
No known key found for this signature in database
GPG Key ID: 0EAC21787E74EF96

@ -69,6 +69,12 @@ func EnableBootTimeCache(enable bool) {
enableBootTimeCache = enable
}
// RefreshBootTimeCache manually refreshes the cached BootTime value.
func RefreshBootTimeCache(ctx context.Context) error {
_, err := common.BootTimeWithContext(ctx, false)
return err
}
func Info() (*InfoStat, error) {
return InfoWithContext(context.Background())
}

Loading…
Cancel
Save