Refactor: use universal FileHeader when handling file upload, remove usage of global ctx with FileHeader, SavePath, DisableOverwrite
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
|
||||
model "github.com/cloudreve/Cloudreve/v3/models"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem"
|
||||
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
|
||||
)
|
||||
|
||||
// DecompressTask 文件压缩任务
|
||||
@@ -83,11 +82,7 @@ func (job *DecompressTask) Do() {
|
||||
|
||||
job.TaskModel.SetProgress(DecompressingProgress)
|
||||
|
||||
// 禁止重名覆盖
|
||||
ctx := context.Background()
|
||||
ctx = context.WithValue(ctx, fsctx.DisableOverwrite, true)
|
||||
|
||||
err = fs.Decompress(ctx, job.TaskProps.Src, job.TaskProps.Dst)
|
||||
err = fs.Decompress(context.Background(), job.TaskProps.Src, job.TaskProps.Dst)
|
||||
if err != nil {
|
||||
job.SetErrorMsg("解压缩失败", err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user