[MM-32622] Remove app.WaitForChannelMembership() (#17048)

* Remove app.WaitForChannelMembership

* Fix tests

* Fix test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Claudio Costa
2021-03-31 09:40:35 +02:00
коммит произвёл GitHub
родитель 4ba0c09fc7
Коммит ee3f986da0
32 изменённых файлов: 211 добавлений и 227 удалений

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

@@ -1183,7 +1183,7 @@ func (s *OpenTracingLayerChannelStore) GetGuestCount(channelID string, allowFrom
return result, err
}
func (s *OpenTracingLayerChannelStore) GetMember(channelID string, userId string) (*model.ChannelMember, error) {
func (s *OpenTracingLayerChannelStore) GetMember(ctx context.Context, channelID string, userId string) (*model.ChannelMember, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelStore.GetMember")
s.Root.Store.SetContext(newCtx)
@@ -1192,7 +1192,7 @@ func (s *OpenTracingLayerChannelStore) GetMember(channelID string, userId string
}()
defer span.Finish()
result, err := s.ChannelStore.GetMember(channelID, userId)
result, err := s.ChannelStore.GetMember(ctx, channelID, userId)
if err != nil {
span.LogFields(spanlog.Error(err))
ext.Error.Set(span, true)
@@ -1232,7 +1232,7 @@ func (s *OpenTracingLayerChannelStore) GetMemberCountFromCache(channelID string)
return result
}
func (s *OpenTracingLayerChannelStore) GetMemberCountsByGroup(channelID string, includeTimezones bool) ([]*model.ChannelMemberCountByGroup, error) {
func (s *OpenTracingLayerChannelStore) GetMemberCountsByGroup(ctx context.Context, channelID string, includeTimezones bool) ([]*model.ChannelMemberCountByGroup, error) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelStore.GetMemberCountsByGroup")
s.Root.Store.SetContext(newCtx)
@@ -1241,7 +1241,7 @@ func (s *OpenTracingLayerChannelStore) GetMemberCountsByGroup(channelID string,
}()
defer span.Finish()
result, err := s.ChannelStore.GetMemberCountsByGroup(channelID, includeTimezones)
result, err := s.ChannelStore.GetMemberCountsByGroup(ctx, channelID, includeTimezones)
if err != nil {
span.LogFields(spanlog.Error(err))
ext.Error.Set(span, true)