prysm-pulse/shared/maxprocs/maxprocs.go
Preston Van Loon b099cab9b1
automaxprocs: Log error to DEBUG instead of panic (#6592)
* Log error to DEBUG instead of panic. Fixes #6591
* Merge branch 'master' into fix-6591
2020-07-14 01:51:07 +00:00

18 lines
412 B
Go

// Package maxprocs automatically sets GOMAXPROCS to match the Linux
// container CPU quota, if any. This will not override the environment
// variable of GOMAXPROCS.
package maxprocs
import (
log "github.com/sirupsen/logrus"
"go.uber.org/automaxprocs/maxprocs"
)
// Initialize Uber maxprocs.
func init() {
_, err := maxprocs.Set()
if err != nil {
log.WithError(err).Debug("Failed to set maxprocs")
}
}