mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 07:43:29 +03:00
Simplify access to local node name (#11907)
The local node name is heavily used in tracing, create a new global variable to store it. Multiple goroutines can access it since it won't be changed later.
This commit is contained in:
@@ -34,7 +34,7 @@ import (
|
||||
func getLocalOsInfo(ctx context.Context, r *http.Request) madmin.ServerOsInfo {
|
||||
addr := r.Host
|
||||
if globalIsDistErasure {
|
||||
addr = GetLocalPeer(globalEndpoints)
|
||||
addr = globalLocalNodeName
|
||||
}
|
||||
|
||||
srvrOsInfo := madmin.ServerOsInfo{Addr: addr}
|
||||
@@ -65,7 +65,7 @@ func getLocalOsInfo(ctx context.Context, r *http.Request) madmin.ServerOsInfo {
|
||||
func getLocalDiskHwInfo(ctx context.Context, r *http.Request) madmin.ServerDiskHwInfo {
|
||||
addr := r.Host
|
||||
if globalIsDistErasure {
|
||||
addr = GetLocalPeer(globalEndpoints)
|
||||
addr = globalLocalNodeName
|
||||
}
|
||||
|
||||
parts, err := diskhw.PartitionsWithContext(ctx, true)
|
||||
|
||||
Reference in New Issue
Block a user