Merge pull request #3796 from nats-io/issue-3793

Update snapshots to numCores and maxProcs after maxrocs.Set()
This commit is contained in:
Derek Collison
2023-01-20 13:28:18 -08:00
committed by GitHub
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"`