Fixing problem with read-replica on indexing files (#17460)

Этот коммит содержится в:
Jesús Espino
2021-04-20 12:30:43 +02:00
коммит произвёл GitHub
родитель 4295a1f556
Коммит 368b642105
7 изменённых файлов: 95 добавлений и 4 удалений

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

@@ -2882,6 +2882,22 @@ func (s *TimerLayerFileInfoStore) GetForUser(userID string) ([]*model.FileInfo,
return result, err
}
func (s *TimerLayerFileInfoStore) GetFromMaster(id string) (*model.FileInfo, error) {
start := timemodule.Now()
result, err := s.FileInfoStore.GetFromMaster(id)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.GetFromMaster", success, elapsed)
}
return result, err
}
func (s *TimerLayerFileInfoStore) GetWithOptions(page int, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, error) {
start := timemodule.Now()