[MM-28423] Implement ImportDelete job (#16588)

* Implement ImportDelete job

* Add missing translation

* Improve logging

* Avoid deleting the file in case of errors
Этот коммит содержится в:
Claudio Costa
2021-01-25 10:40:30 +01:00
коммит произвёл GitHub
родитель b932e0fb25
Коммит 200a56fa5a
22 изменённых файлов: 401 добавлений и 4 удалений

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

@@ -158,6 +158,19 @@ func (a *App) FileSize(path string) (int64, *model.AppError) {
return size, nil
}
func (a *App) FileModTime(path string) (time.Time, *model.AppError) {
backend, err := a.FileBackend()
if err != nil {
return time.Time{}, err
}
modTime, nErr := backend.FileModTime(path)
if nErr != nil {
return time.Time{}, model.NewAppError("FileModTime", "api.file.file_mod_time.app_error", nil, nErr.Error(), http.StatusInternalServerError)
}
return modTime, nil
}
func (a *App) MoveFile(oldPath, newPath string) *model.AppError {
backend, err := a.FileBackend()
if err != nil {