Skip to content

Commit

Permalink
fix: do not fatal on automaxprocs error (#3946)
Browse files Browse the repository at this point in the history
This might fail on windows/wsl (see
uber-go/automaxprocs#65), and its not too bad
if it fails, actually, so, let's just warn the error instead of exiting
1

closes #3945



Signed-off-by: Carlos Alexandro Becker
<caarlos0@users.noreply.github.com>

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Apr 18, 2023
1 parent 3c7a639 commit 6afe717
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Expand Up @@ -29,7 +29,8 @@ func init() {
// automatically set GOMAXPROCS to match available CPUs.
// GOMAXPROCS will be used as the default value for the --parallelism flag.
if _, err := maxprocs.Set(); err != nil {
log.WithError(err).Fatal("failed to set GOMAXPROCS")
// might fail on WSL...
log.WithError(err).Warn("failed to set GOMAXPROCS")
}
}

Expand Down

0 comments on commit 6afe717

Please sign in to comment.