mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Update snapshots to numCores and maxProcs after maxrocs.Set()
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
2
main.go
2
main.go
@@ -134,6 +134,8 @@ func main() {
|
||||
s.Warnf("Failed to set GOMAXPROCS: %v", err)
|
||||
} else {
|
||||
defer undo()
|
||||
// Reset these from the snapshots from init for monitor.go
|
||||
server.SnapshotMonitorInfo()
|
||||
}
|
||||
|
||||
s.WaitForShutdown()
|
||||
|
||||
@@ -40,11 +40,15 @@ import (
|
||||
var numCores int
|
||||
var maxProcs int
|
||||
|
||||
func init() {
|
||||
func SnapshotMonitorInfo() {
|
||||
numCores = runtime.NumCPU()
|
||||
maxProcs = runtime.GOMAXPROCS(0)
|
||||
}
|
||||
|
||||
func init() {
|
||||
SnapshotMonitorInfo()
|
||||
}
|
||||
|
||||
// Connz represents detailed information on current client connections.
|
||||
type Connz struct {
|
||||
ID string `json:"server_id"`
|
||||
|
||||
Reference in New Issue
Block a user