mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 17:41:57 +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 尝试为本地策略文件生成缩略图并获取图像原始大小
|
// GenerateThumbnail 尝试为本地策略文件生成缩略图并获取图像原始大小
|
||||||
// TODO 失败时,如果之前还有图像信息,则清除
|
// TODO 失败时,如果之前还有图像信息,则清除
|
||||||
func (fs *FileSystem) GenerateThumbnail(ctx context.Context, file *model.File) {
|
func (fs *FileSystem) GenerateThumbnail(ctx context.Context, file *model.File) {
|
||||||
|
defer fs.Recycle()
|
||||||
|
|
||||||
// 判断是否可以生成缩略图
|
// 判断是否可以生成缩略图
|
||||||
if !IsInExtensionList(HandledExtension, file.Name) {
|
if !IsInExtensionList(HandledExtension, file.Name) {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ func (job *CompressTask) Do() {
|
|||||||
job.SetErrorMsg(err.Error())
|
job.SetErrorMsg(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer fs.Recycle()
|
|
||||||
|
|
||||||
util.Log().Debug("开始压缩文件")
|
util.Log().Debug("开始压缩文件")
|
||||||
job.TaskModel.SetProgress(CompressingProgress)
|
job.TaskModel.SetProgress(CompressingProgress)
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ func (job *TransferTask) Do() {
|
|||||||
job.SetErrorMsg(err.Error(), nil)
|
job.SetErrorMsg(err.Error(), nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer fs.Recycle()
|
|
||||||
|
|
||||||
for index, file := range job.TaskProps.Src {
|
for index, file := range job.TaskProps.Src {
|
||||||
job.TaskModel.SetProgress(index)
|
job.TaskModel.SetProgress(index)
|
||||||
|
|||||||
Reference in New Issue
Block a user