[process] 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 e230f528f0
commit 642e1d7e92
No known key found for this signature in database
GPG Key ID: 0EAC21787E74EF96

@ -178,6 +178,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
}
// Pids returns a slice of process ID list which are running now.
func Pids() ([]int32, error) {
return PidsWithContext(context.Background())

Loading…
Cancel
Save