Skip to content

Commit

Permalink
Modify: stop recycle filesystem when generate thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
HFO4 committed Mar 11, 2020
1 parent 4de0a25 commit 439b5a2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions pkg/filesystem/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ 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
Expand Down
2 changes: 0 additions & 2 deletions pkg/task/tranfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ func (job *TransferTask) GetError() *JobError {

// Do 开始执行任务
func (job *TransferTask) Do() {
defer job.Recycle()

// 创建文件系统
fs, err := filesystem.NewFileSystem(job.User)
if err != nil {
Expand Down

0 comments on commit 439b5a2

Please sign in to comment.