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

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

@@ -7080,6 +7080,22 @@ func (s *TimerLayerThreadStore) GetThreadForUser(userId string, teamId string, t
return result, err
}
func (s *TimerLayerThreadStore) GetThreadMentionsForUserPerChannel(userId string, teamId string) (map[string]int64, error) {
start := timemodule.Now()
result, err := s.ThreadStore.GetThreadMentionsForUserPerChannel(userId, teamId)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ThreadStore.GetThreadMentionsForUserPerChannel", success, elapsed)
}
return result, err
}
func (s *TimerLayerThreadStore) GetThreadsForUser(userId string, teamId string, opts model.GetUserThreadsOpts) (*model.Threads, error) {
start := timemodule.Now()