Addressed review comments
This commit is contained in:
parent
d64b02f07d
commit
62f99cc629
|
@ -12,7 +12,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// We use this constant to override the built in 3 second timeout in gopsutil
|
// cpuInfoTimeout is the timeout used when gathering CPU info. This is used
|
||||||
|
// to override the default timeout in gopsutil which has a tendency to
|
||||||
|
// timeout on Windows.
|
||||||
cpuInfoTimeout = 10 * time.Second
|
cpuInfoTimeout = 10 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -36,7 +38,6 @@ func Init() error {
|
||||||
|
|
||||||
var cpuInfo []cpu.InfoStat
|
var cpuInfo []cpu.InfoStat
|
||||||
ctx, _ := context.WithTimeout(context.Background(), cpuInfoTimeout)
|
ctx, _ := context.WithTimeout(context.Background(), cpuInfoTimeout)
|
||||||
|
|
||||||
if cpuInfo, err = cpu.InfoWithContext(ctx); err != nil {
|
if cpuInfo, err = cpu.InfoWithContext(ctx); err != nil {
|
||||||
merrs = multierror.Append(merrs, fmt.Errorf("Unable to obtain CPU information: %v", initErr))
|
merrs = multierror.Append(merrs, fmt.Errorf("Unable to obtain CPU information: %v", initErr))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue