fix: align group management APIs
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@@ -1375,6 +1376,22 @@ func currentNodeID() string {
|
||||
if globals.cluster != nil && globals.cluster.thisNodeName != "" {
|
||||
return globals.cluster.thisNodeName
|
||||
}
|
||||
if globals.nodeID != "" {
|
||||
return globals.nodeID
|
||||
}
|
||||
return resolveIMNodeID("")
|
||||
}
|
||||
|
||||
func resolveIMNodeID(configured string) string {
|
||||
if configured = strings.TrimSpace(configured); configured != "" {
|
||||
return configured
|
||||
}
|
||||
if value := strings.TrimSpace(os.Getenv("IM_NODE_ID")); value != "" {
|
||||
return value
|
||||
}
|
||||
if value := strings.TrimSpace(os.Getenv("HOSTNAME")); value != "" {
|
||||
return value
|
||||
}
|
||||
return "local"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user