Fix: recycle error when handling upload task
This commit is contained in:
parent
8ad7702736
commit
4de0a2577a
3 changed files with 2 additions and 2 deletions
|
@ -45,6 +45,8 @@ func (fs *FileSystem) GetThumb(ctx context.Context, id uint) (*response.ContentR
|
|||
// GenerateThumbnail 尝试为本地策略文件生成缩略图并获取图像原始大小
|
||||
// TODO 失败时,如果之前还有图像信息,则清除
|
||||
func (fs *FileSystem) GenerateThumbnail(ctx context.Context, file *model.File) {
|
||||
defer fs.Recycle()
|
||||
|
||||
// 判断是否可以生成缩略图
|
||||
if !IsInExtensionList(HandledExtension, file.Name) {
|
||||
return
|
||||
|
|
|
@ -88,7 +88,6 @@ func (job *CompressTask) Do() {
|
|||
job.SetErrorMsg(err.Error())
|
||||
return
|
||||
}
|
||||
defer fs.Recycle()
|
||||
|
||||
util.Log().Debug("开始压缩文件")
|
||||
job.TaskModel.SetProgress(CompressingProgress)
|
||||
|
|
|
@ -86,7 +86,6 @@ func (job *TransferTask) Do() {
|
|||
job.SetErrorMsg(err.Error(), nil)
|
||||
return
|
||||
}
|
||||
defer fs.Recycle()
|
||||
|
||||
for index, file := range job.TaskProps.Src {
|
||||
job.TaskModel.SetProgress(index)
|
||||
|
|
Loading…
Reference in a new issue