[MM-29111] Fix errcheck issues in server/channels/app/upload.go (#30678)

Co-authored-by: Claude <noreply@anthropic.com>
Этот коммит содержится в:
Ben Schumacher
2025-05-07 13:40:51 +02:00
коммит произвёл GitHub
родитель bfb15ab179
Коммит 92011a6c75
2 изменённых файлов: 10 добавлений и 2 удалений

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

@@ -97,7 +97,6 @@ issues:
channels/app/platform/license.go|\
channels/app/slashcommands/command_test.go|\
channels/app/slashcommands/helper_test.go|\
channels/app/upload.go|\
channels/store/localcachelayer/channel_layer.go|\
channels/store/localcachelayer/channel_layer_test.go|\
channels/store/localcachelayer/emoji_layer.go|\

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

@@ -230,7 +230,16 @@ func (a *App) UploadData(c request.CTX, us *model.UploadSession, rd io.Reader) (
return nil, err
}
if written < minFirstPartSize && written != us.FileSize {
a.RemoveFile(uploadPath)
if fileErr := a.RemoveFile(uploadPath); fileErr != nil {
c.Logger().Warn("Failed to remove initial upload chunk that was too small",
mlog.Err(fileErr),
mlog.String("upload_path", uploadPath),
mlog.String("upload_id", us.Id),
mlog.String("filename", us.Filename),
mlog.Int("chunk_size", int(written)),
mlog.Int("min_size", minFirstPartSize),
)
}
var errStr string
if err != nil {
errStr = err.Error()