Update snapshots to numCores and maxProcs after maxrocs.Set()

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-01-20 11:30:43 -08:00
parent f2b087c567
commit 2aeb5e2c5a
2 changed files with 7 additions and 1 deletions

View File

@@ -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()

View File

@@ -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"`