AutoMaxProcs would default log output, this suppresses the logging.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2022-06-28 16:35:30 -07:00
parent dff1a33693
commit c2de707ed6

11
main.go
View File

@@ -1,4 +1,4 @@
// Copyright 2012-2021 The NATS Authors
// Copyright 2012-2022 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -20,9 +20,8 @@ import (
"fmt"
"os"
_ "go.uber.org/automaxprocs"
"github.com/nats-io/nats-server/v2/server"
"go.uber.org/automaxprocs/maxprocs"
)
var usageStr = `
@@ -116,6 +115,12 @@ func main() {
// Configure the logger based on the flags
s.ConfigureLogger()
// Adjust MAXPROCS if running under linux/cgroups quotas.
// We ignore undo.
if _, err := maxprocs.Set(); err != nil {
server.PrintAndDie(fmt.Sprintf("failed to set GOMAXPROCS: %v", err))
}
// Start things up. Block here until done.
if err := server.Run(s); err != nil {
server.PrintAndDie(err.Error())