mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
AutoMaxProcs would default log output, this suppresses the logging.
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
11
main.go
11
main.go
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user