Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions cmd/server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"github.com/rs/cors"
"github.com/spf13/cobra"
"github.com/urfave/negroni"
"go.uber.org/automaxprocs/maxprocs"

"github.com/ory/graceful"
"github.com/ory/x/healthx"
Expand Down Expand Up @@ -191,14 +190,6 @@ func RunServeAll(slOpts []servicelocatorx.Option, dOpts []driver.OptionsModifier
func setup(ctx context.Context, d driver.Registry, cmd *cobra.Command) (admin *httprouterx.RouterAdmin, public *httprouterx.RouterPublic, adminmw, publicmw *negroni.Negroni) {
fmt.Println(banner(config.Version))

if d.Config().CGroupsV1AutoMaxProcsEnabled() {
_, err := maxprocs.Set(maxprocs.Logger(d.Logger().Infof))

if err != nil {
d.Logger().WithError(err).Fatal("Couldn't set GOMAXPROCS")
}
}

adminmw = negroni.New()
publicmw = negroni.New()

Expand Down
9 changes: 9 additions & 0 deletions driver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io/fs"

"github.com/pkg/errors"
"go.uber.org/automaxprocs/maxprocs"

"github.com/ory/hydra/v2/driver/config"
"github.com/ory/hydra/v2/fositex"
Expand Down Expand Up @@ -141,6 +142,14 @@ func New(ctx context.Context, sl *servicelocatorx.Options, opts []OptionsModifie
}
}

if c.CGroupsV1AutoMaxProcsEnabled() {
_, err := maxprocs.Set(maxprocs.Logger(l.Infof))

if err != nil {
l.WithError(err).Fatal("Couldn't set GOMAXPROCS")
}
}

r, err := NewRegistryWithoutInit(c, l)
if err != nil {
l.WithError(err).Error("Unable to create service registry.")
Expand Down
Loading