Skip to content

Commit

Permalink
[host] add RefreshBootTimeCache function
Browse files Browse the repository at this point in the history
This commit adds the RefreshBootTimeCache function, allowing users to
manually refresh the cached boot time if they are using the
`enableBootTimeCache` feature.
  • Loading branch information
braydonk committed Mar 27, 2024
1 parent 642e1d7 commit f6350ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions host/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down

0 comments on commit f6350ce

Please sign in to comment.