mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-27 01:51:56 +08:00
Fix: recycle error when handling upload task
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user