clean up legacy rpc (#2384)

* clean up legacy rpc

* cleanup

* cleanup

* cleanup

* tidy

* cleanup

* cleanup
This commit is contained in:
Paul Wells
2024-01-14 01:49:26 -08:00
committed by GitHub
parent 1cb4b3e585
commit 3f2f850bdb
13 changed files with 45 additions and 937 deletions
+10 -20
View File
@@ -102,27 +102,17 @@ func (s *defaultSessionHandler) HandleSession(
) error {
prometheus.IncrementParticipantRtcInit(1)
if rr, ok := s.router.(*routing.RedisRouter); ok {
rtcNode, err := s.router.GetNodeForRoom(ctx, roomName)
if err != nil {
return err
}
rtcNode, err := s.router.GetNodeForRoom(ctx, roomName)
if err != nil {
return err
}
if rtcNode.Id != s.currentNode.Id {
err = routing.ErrIncorrectRTCNode
logger.Errorw("called participant on incorrect node", err,
"rtcNode", rtcNode,
)
return err
}
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, s.currentNode.Id); err != nil {
return err
}
if rtcNode.Id != s.currentNode.Id {
err = routing.ErrIncorrectRTCNode
logger.Errorw("called participant on incorrect node", err,
"rtcNode", rtcNode,
)
return err
}
return s.roomManager.StartSession(ctx, roomName, pi, requestSource, responseSink)