[MM-41998] Channel Info RHS: display number of files for a channel (#19822)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Julien Tant
2022-03-25 13:28:14 -07:00
коммит произвёл GitHub
родитель 1c49366f00
Коммит 0babc01749
15 изменённых файлов: 181 добавлений и 0 удалений

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

@@ -1402,6 +1402,27 @@ func (s *RetryLayerChannelStore) GetDeletedByName(team_id string, name string) (
}
func (s *RetryLayerChannelStore) GetFileCount(channelID string) (int64, error) {
tries := 0
for {
result, err := s.ChannelStore.GetFileCount(channelID)
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) GetForPost(postID string) (*model.Channel, error) {
tries := 0