[MM-28423] Implement ImportDelete job (#16588)
* Implement ImportDelete job * Add missing translation * Improve logging * Avoid deleting the file in case of errors
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b932e0fb25
Коммит
200a56fa5a
13
app/file.go
13
app/file.go
@@ -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 {
|
||||
|
||||
Ссылка в новой задаче
Block a user