fix: align group management APIs

This commit is contained in:
richjohnrambo
2026-09-13 16:03:55 +08:00
parent f1279ac607
commit a9afc6ff6a
34 changed files with 1381 additions and 639 deletions
+17
View File
@@ -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"
}