Add back region when hydrating ParticipantInit. (#648)
It was left out in the previous PR #646
This commit is contained in:
@@ -122,7 +122,7 @@ func (pi *ParticipantInit) ToStartSession(roomName livekit.RoomName, connectionI
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParticipantInitFromStartSession(ss *livekit.StartSession) (*ParticipantInit, error) {
|
func ParticipantInitFromStartSession(ss *livekit.StartSession, region string) (*ParticipantInit, error) {
|
||||||
claims := &auth.ClaimGrants{}
|
claims := &auth.ClaimGrants{}
|
||||||
if err := json.Unmarshal([]byte(ss.GrantsJson), claims); err != nil {
|
if err := json.Unmarshal([]byte(ss.GrantsJson), claims); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -135,6 +135,7 @@ func ParticipantInitFromStartSession(ss *livekit.StartSession) (*ParticipantInit
|
|||||||
Client: ss.Client,
|
Client: ss.Client,
|
||||||
AutoSubscribe: ss.AutoSubscribe,
|
AutoSubscribe: ss.AutoSubscribe,
|
||||||
Grants: claims,
|
Grants: claims,
|
||||||
|
Region: region,
|
||||||
AdaptiveStream: ss.AdaptiveStream,
|
AdaptiveStream: ss.AdaptiveStream,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user