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:
@@ -30,7 +30,7 @@ import (
|
||||
func getLocalDiskHwInfo(ctx context.Context, r *http.Request) madmin.ServerDiskHwInfo {
|
||||
addr := r.Host
|
||||
if globalIsDistErasure {
|
||||
addr = GetLocalPeer(globalEndpoints)
|
||||
addr = globalLocalNodeName
|
||||
}
|
||||
|
||||
return madmin.ServerDiskHwInfo{
|
||||
@@ -42,7 +42,7 @@ func getLocalDiskHwInfo(ctx context.Context, r *http.Request) madmin.ServerDiskH
|
||||
func getLocalOsInfo(ctx context.Context, r *http.Request) madmin.ServerOsInfo {
|
||||
addr := r.Host
|
||||
if globalIsDistErasure {
|
||||
addr = GetLocalPeer(globalEndpoints)
|
||||
addr = globalLocalNodeName
|
||||
}
|
||||
|
||||
return madmin.ServerOsInfo{
|
||||
|
||||
Reference in New Issue
Block a user