fixed multi-node so signal node can start sessions

This commit is contained in:
David Zhao
2021-01-26 23:52:55 -08:00
parent 940b96168d
commit 61db4f5b66
9 changed files with 48 additions and 42 deletions
-1
View File
@@ -6,7 +6,6 @@ var (
ErrNotFound = errors.New("could not find object")
ErrHandlerNotDefined = errors.New("handler not defined")
ErrNoAvailableNodes = errors.New("could not find any available nodes")
ErrIncorrectNodeForRoom = errors.New("incorrect node for the current room")
errInvalidRouterMessage = errors.New("invalid router message")
ErrChannelClosed = errors.New("channel closed")
)
+1 -7
View File
@@ -161,12 +161,7 @@ func (r *RedisRouter) StartParticipant(roomName, participantId, participantName
return err
}
// StartParticipant should only be called on the current node
if rtcNode != r.currentNode.Id {
return ErrIncorrectNodeForRoom
}
if r.useLocal {
if r.useLocal && rtcNode == r.currentNode.Id {
return r.LocalRouter.StartParticipant(roomName, participantId, participantId)
}
@@ -282,7 +277,6 @@ func (r *RedisRouter) subscribeWorker() {
continue
}
logger.Debugw("received redis message", "message", msg, "node", r.currentNode.Id)
rm := livekit.RouterMessage{}
err = proto.Unmarshal([]byte(msg.Payload), &rm)
pId := rm.ParticipantId