set participant node for redis router in signal service (#1584)

This commit is contained in:
Paul Wells
2023-04-05 16:08:25 -07:00
committed by GitHub
parent 234f7ea5cb
commit 6b0cb33c53
5 changed files with 43 additions and 25 deletions
+11
View File
@@ -77,6 +77,17 @@ func NewDefaultSignalServer(
responseSink routing.MessageSink,
) error {
prometheus.IncrementParticipantRtcInit(1)
if rr, ok := router.(*routing.RedisRouter); ok {
pKey := routing.ParticipantKeyLegacy(roomName, pi.Identity)
pKeyB62 := routing.ParticipantKey(roomName, pi.Identity)
// RTC session should start on this node
if err := rr.SetParticipantRTCNode(pKey, pKeyB62, currentNode.Id); err != nil {
return err
}
}
return roomManager.StartSession(ctx, roomName, pi, requestSource, responseSink)
}