Revert "MM-55295: Improve DB performance of some APIs (#25318)" (#25852)

This reverts commit ec88ab4ee9.
Этот коммит содержится в:
Claudio Costa
2024-01-05 10:05:37 -06:00
коммит произвёл GitHub
родитель 4b88bfd5fb
Коммит 077221a940
12 изменённых файлов: 53 добавлений и 189 удалений

Просмотреть файл

@@ -1049,11 +1049,11 @@ func (s *RetryLayerChannelStore) GetAll(teamID string) ([]*model.Channel, error)
}
func (s *RetryLayerChannelStore) GetAllChannelMemberIdsByChannelId(id string) ([]string, error) {
func (s *RetryLayerChannelStore) GetAllChannelMembersById(id string) ([]string, error) {
tries := 0
for {
result, err := s.ChannelStore.GetAllChannelMemberIdsByChannelId(id)
result, err := s.ChannelStore.GetAllChannelMembersById(id)
if err == nil {
return result, nil
}
@@ -1748,27 +1748,6 @@ func (s *RetryLayerChannelStore) GetMemberForPost(postID string, userID string)
}
func (s *RetryLayerChannelStore) GetMemberOnly(ctx context.Context, channelID string, userID string) (*model.ChannelMember, error) {
tries := 0
for {
result, err := s.ChannelStore.GetMemberOnly(ctx, channelID, userID)
if err == nil {
return result, nil
}
if !isRepeatableError(err) {
return result, err
}
tries++
if tries >= 3 {
err = errors.Wrap(err, "giving up after 3 consecutive repeatable transaction failures")
return result, err
}
timepkg.Sleep(100 * timepkg.Millisecond)
}
}
func (s *RetryLayerChannelStore) GetMembers(channelID string, offset int, limit int) (model.ChannelMembers, error) {
tries := 0