summaryrefslogtreecommitdiff
path: root/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups.go')
-rw-r--r--vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups.go b/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups.go
index e6c173197..e89f54360 100644
--- a/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups.go
+++ b/vendor/go.uber.org/automaxprocs/internal/cgroups/cgroups.go
@@ -110,8 +110,8 @@ func (cg CGroups) CPUQuota() (float64, bool, error) {
}
cfsPeriodUs, err := cpuCGroup.readInt(_cgroupCPUCFSPeriodUsParam)
- if err != nil {
- return -1, false, err
+ if defined := cfsPeriodUs > 0; err != nil || !defined {
+ return -1, defined, err
}
return float64(cfsQuotaUs) / float64(cfsPeriodUs), true, nil