Replace db count query in user signup process (#18072)

Этот коммит содержится в:
Claudio Costa
2021-08-12 11:23:21 +02:00
коммит произвёл GitHub
родитель d3973557fc
Коммит bd65e8daf9
12 изменённых файлов: 126 добавлений и 9 удалений

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

@@ -9345,6 +9345,22 @@ func (s *TimerLayerUserStore) InvalidateProfilesInChannelCacheByUser(userID stri
}
}
func (s *TimerLayerUserStore) IsEmpty() (bool, error) {
start := timemodule.Now()
result, err := s.UserStore.IsEmpty()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.IsEmpty", success, elapsed)
}
return result, err
}
func (s *TimerLayerUserStore) PermanentDelete(userID string) error {
start := timemodule.Now()