Add back region when hydrating ParticipantInit. (#648)

It was left out in the previous PR #646
This commit is contained in:
David Zhao
2022-04-24 09:07:33 -07:00
committed by GitHub
parent d38566850a
commit 26700ea135
2 changed files with 3 additions and 2 deletions

View File

@@ -122,7 +122,7 @@ func (pi *ParticipantInit) ToStartSession(roomName livekit.RoomName, connectionI
}, nil
}
func ParticipantInitFromStartSession(ss *livekit.StartSession) (*ParticipantInit, error) {
func ParticipantInitFromStartSession(ss *livekit.StartSession, region string) (*ParticipantInit, error) {
claims := &auth.ClaimGrants{}
if err := json.Unmarshal([]byte(ss.GrantsJson), claims); err != nil {
return nil, err
@@ -135,6 +135,7 @@ func ParticipantInitFromStartSession(ss *livekit.StartSession) (*ParticipantInit
Client: ss.Client,
AutoSubscribe: ss.AutoSubscribe,
Grants: claims,
Region: region,
AdaptiveStream: ss.AdaptiveStream,
}, nil
}

View File

@@ -240,7 +240,7 @@ func (r *RedisRouter) startParticipantRTC(ss *livekit.StartSession, participantK
}
}
pi, err := ParticipantInitFromStartSession(ss)
pi, err := ParticipantInitFromStartSession(ss, r.currentNode.Region)
if err != nil {
return err
}