Skip to content

Commit

Permalink
Merge pull request #6159 from TheThingsNetwork/fix/avoid-automaxprocs…
Browse files Browse the repository at this point in the history
…-logs

Avoid automaxprocs logs
  • Loading branch information
adriansmares authored Apr 14, 2023
2 parents bcbda8a + c3059f4 commit 895c886
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions cmd/internal/shared/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import (

"go.thethings.network/lorawan-stack/v3/pkg/config"
"go.thethings.network/lorawan-stack/v3/pkg/log"

_ "go.uber.org/automaxprocs" // Automatically set `GOMAXPROCS` in derived commands.
)

// InitializeFallbacks initializes configuration fallbacks.
Expand Down
5 changes: 5 additions & 0 deletions cmd/ttn-lw-stack/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
logobservability "go.thethings.network/lorawan-stack/v3/pkg/log/middleware/observability"
logsentry "go.thethings.network/lorawan-stack/v3/pkg/log/middleware/sentry"
pkgversion "go.thethings.network/lorawan-stack/v3/pkg/version"
"go.uber.org/automaxprocs/maxprocs"
)

var errMissingFlag = errors.DefineInvalidArgument("missing_flag", "missing CLI flag `{flag}`")
Expand Down Expand Up @@ -105,6 +106,10 @@ var (
logger.Use(logsentry.New())
}

if _, err := maxprocs.Set(); err != nil {
logger.WithError(err).Debug("Failed to set GOMAXPROCS")
}

ctx = log.NewContext(ctx, logger)

// check version in background
Expand Down

0 comments on commit 895c886

Please sign in to comment.