Add AWS Metering service support (#15290)

Этот коммит содержится в:
catalintomai
2020-09-28 11:43:08 -07:00
коммит произвёл GitHub
родитель 50e37068b5
Коммит 1c0d590c81
199 изменённых файлов: 38917 добавлений и 4 удалений

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

@@ -7384,6 +7384,26 @@ func (s *RetryLayerUserStore) AnalyticsActiveCount(time int64, options model.Use
}
func (s *RetryLayerUserStore) AnalyticsActiveCountForPeriod(startTime int64, endTime int64, options model.UserCountOptions) (int64, error) {
tries := 0
for {
result, err := s.UserStore.AnalyticsActiveCountForPeriod(startTime, endTime, options)
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 *RetryLayerUserStore) AnalyticsGetExternalUsers(hostDomain string) (bool, *model.AppError) {
return s.UserStore.AnalyticsGetExternalUsers(hostDomain)