MM-32525 Incorrect number of mentions for channels when threads are enabled (#16853)

Этот коммит содержится в:
Eli Yukelzon
2021-02-09 12:03:32 +02:00
коммит произвёл GitHub
родитель 78b82769ca
Коммит 9a33c3706a
13 изменённых файлов: 195 добавлений и 12 удалений

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

@@ -8518,6 +8518,26 @@ func (s *RetryLayerThreadStore) GetThreadForUser(userId string, teamId string, t
}
func (s *RetryLayerThreadStore) GetThreadMentionsForUserPerChannel(userId string, teamId string) (map[string]int64, error) {
tries := 0
for {
result, err := s.ThreadStore.GetThreadMentionsForUserPerChannel(userId, teamId)
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
}
}
}
func (s *RetryLayerThreadStore) GetThreadsForUser(userId string, teamId string, opts model.GetUserThreadsOpts) (*model.Threads, error) {
tries := 0