fix: align group management APIs
This commit is contained in:
+6
-3
@@ -146,6 +146,8 @@ var globals struct {
|
||||
sessionStore *SessionStore
|
||||
// Cluster data.
|
||||
cluster *Cluster
|
||||
// Unique node ID used by Redis realtime fanout when native clustering is disabled.
|
||||
nodeID string
|
||||
// gRPC server.
|
||||
grpcServer *grpc.Server
|
||||
// Plugins.
|
||||
@@ -346,6 +348,8 @@ type configType struct {
|
||||
ExpvarPath string `json:"expvar"`
|
||||
// URL path for internal server status. Disabled if the path is blank.
|
||||
ServerStatusPath string `json:"server_status"`
|
||||
// Unique IM node ID for Redis realtime fanout. Defaults to IM_NODE_ID or HOSTNAME.
|
||||
NodeID string `json:"node_id"`
|
||||
// Take IP address of the client from HTTP header 'X-Forwarded-For'.
|
||||
// Useful when tinode is behind a proxy. If missing, fallback to default RemoteAddr.
|
||||
UseXForwardedFor bool `json:"use_x_forwarded_for"`
|
||||
@@ -466,6 +470,7 @@ func main() {
|
||||
// Initialize cluster and receive calculated workerId.
|
||||
// Cluster won't be started here yet.
|
||||
workerId := clusterInit(config.Cluster, clusterSelf)
|
||||
globals.nodeID = resolveIMNodeID(config.NodeID)
|
||||
|
||||
if *pprofFile != "" {
|
||||
*pprofFile = toAbsolutePath(curwd, *pprofFile)
|
||||
@@ -740,14 +745,12 @@ func main() {
|
||||
globals.sessionStore = NewSessionStore(idleSessionTimeout + 15*time.Second)
|
||||
// The hub (the main message router)
|
||||
globals.hub = newHub()
|
||||
startRedisGroupFanout(context.Background())
|
||||
startRedisRealtimeFanout(context.Background())
|
||||
startKafkaAdminCommandConsumer()
|
||||
startKafkaConfigEventConsumer()
|
||||
startKafkaCacheInvalidateConsumer()
|
||||
startKafkaMessagePersistConsumer()
|
||||
startKafkaDeadLetterConsumer()
|
||||
stopExternalBusinessEvents := startIMExternalBusinessEventPoller()
|
||||
defer stopExternalBusinessEvents()
|
||||
|
||||
// Start accepting cluster traffic.
|
||||
if globals.cluster != nil {
|
||||
|
||||
Reference in New Issue
Block a user