Do not use Redis pipeline for SIP delete. Fixes Redis clustering support. (#3694)
This commit is contained in:
@@ -106,12 +106,19 @@ func (s *RedisStore) LoadSIPOutboundTrunk(ctx context.Context, id string) (*live
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *RedisStore) DeleteSIPTrunk(ctx context.Context, id string) error {
|
func (s *RedisStore) DeleteSIPTrunk(ctx context.Context, id string) error {
|
||||||
tx := s.rc.TxPipeline()
|
err1 := s.rc.HDel(s.ctx, SIPTrunkKey, id).Err()
|
||||||
tx.HDel(s.ctx, SIPTrunkKey, id)
|
err2 := s.rc.HDel(s.ctx, SIPInboundTrunkKey, id).Err()
|
||||||
tx.HDel(s.ctx, SIPInboundTrunkKey, id)
|
err3 := s.rc.HDel(s.ctx, SIPOutboundTrunkKey, id).Err()
|
||||||
tx.HDel(s.ctx, SIPOutboundTrunkKey, id)
|
if err1 != nil {
|
||||||
_, err := tx.Exec(ctx)
|
return err1
|
||||||
return err
|
}
|
||||||
|
if err2 != nil {
|
||||||
|
return err2
|
||||||
|
}
|
||||||
|
if err3 != nil {
|
||||||
|
return err3
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *RedisStore) listSIPLegacyTrunk(ctx context.Context, page *livekit.Pagination) ([]*livekit.SIPTrunkInfo, error) {
|
func (s *RedisStore) listSIPLegacyTrunk(ctx context.Context, page *livekit.Pagination) ([]*livekit.SIPTrunkInfo, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user