[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 удалений

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

@@ -1157,6 +1157,22 @@ func (s *TimerLayerChannelStore) GetDeletedByName(team_id string, name string) (
return result, err
}
func (s *TimerLayerChannelStore) GetFileCount(channelID string) (int64, error) {
start := timemodule.Now()
result, err := s.ChannelStore.GetFileCount(channelID)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.GetFileCount", success, elapsed)
}
return result, err
}
func (s *TimerLayerChannelStore) GetForPost(postID string) (*model.Channel, error) {
start := timemodule.Now()