[MM-55053] Use request-specific logger in channels/app/file.go (#25037)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
45d6fb122f
Коммит
b0bf5d0765
@@ -91,7 +91,7 @@ func (a *App) runPluginsHook(c request.CTX, info *model.FileInfo, file io.Reader
|
||||
written, err := a.WriteFile(r, tmpPath)
|
||||
if err != nil {
|
||||
if fileErr := a.RemoveFile(tmpPath); fileErr != nil {
|
||||
mlog.Warn("Failed to remove file", mlog.Err(fileErr))
|
||||
c.Logger().Warn("Failed to remove file", mlog.Err(fileErr))
|
||||
}
|
||||
r.CloseWithError(err) // always returns nil
|
||||
return err
|
||||
@@ -99,10 +99,10 @@ func (a *App) runPluginsHook(c request.CTX, info *model.FileInfo, file io.Reader
|
||||
|
||||
if err = <-errChan; err != nil {
|
||||
if fileErr := a.RemoveFile(info.Path); fileErr != nil {
|
||||
mlog.Warn("Failed to remove file", mlog.Err(fileErr))
|
||||
c.Logger().Warn("Failed to remove file", mlog.Err(fileErr))
|
||||
}
|
||||
if fileErr := a.RemoveFile(tmpPath); fileErr != nil {
|
||||
mlog.Warn("Failed to remove file", mlog.Err(fileErr))
|
||||
c.Logger().Warn("Failed to remove file", mlog.Err(fileErr))
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -296,7 +296,7 @@ func (a *App) UploadData(c request.CTX, us *model.UploadSession, rd io.Reader) (
|
||||
if fileErr != nil {
|
||||
return nil, fileErr
|
||||
}
|
||||
a.HandleImages([]string{info.PreviewPath}, []string{info.ThumbnailPath}, [][]byte{imgData})
|
||||
a.HandleImages(c, []string{info.PreviewPath}, []string{info.ThumbnailPath}, [][]byte{imgData})
|
||||
}
|
||||
|
||||
if us.Type == model.UploadTypeImport {
|
||||
|
||||
Ссылка в новой задаче
Block a user