Create GetOldestEntityCreationTime method (#14515)

This method will be used by the ES index jobs in order
to get the first timestamp to be used as the starting point
when doing indexing tasks
Этот коммит содержится в:
Mario de Frutos Dieguez
2020-06-18 14:34:23 +02:00
коммит произвёл GitHub
родитель ef85001523
Коммит f6c934d7e0
6 изменённых файлов: 87 добавлений и 2 удалений

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

@@ -4237,6 +4237,22 @@ func (s *TimerLayerPostStore) GetOldest() (*model.Post, *model.AppError) {
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetOldestEntityCreationTime() (int64, *model.AppError) {
start := timemodule.Now()
resultVar0, resultVar1 := s.PostStore.GetOldestEntityCreationTime()
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if resultVar1 == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetOldestEntityCreationTime", success, elapsed)
}
return resultVar0, resultVar1
}
func (s *TimerLayerPostStore) GetParentsForExportAfter(limit int, afterId string) ([]*model.PostForExport, *model.AppError) {
start := timemodule.Now()