mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05: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:
@@ -541,7 +541,7 @@ func errorResponseHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// gets host name for current node
|
||||
func getHostName(r *http.Request) (hostName string) {
|
||||
if globalIsDistErasure {
|
||||
hostName = GetLocalPeer(globalEndpoints)
|
||||
hostName = globalLocalNodeName
|
||||
} else {
|
||||
hostName = r.Host
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user