Fix: panics inside of task was not correctly logged into DB

Feat: slave node use new API to upload file to master
This commit is contained in:
HFO4
2022-03-13 16:20:50 +08:00
parent 9136f3caec
commit c89327631e
10 changed files with 54 additions and 30 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/cloudreve/Cloudreve/v3/pkg/auth"
"github.com/cloudreve/Cloudreve/v3/pkg/cache"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/driver/local"
"github.com/cloudreve/Cloudreve/v3/pkg/filesystem/fsctx"
"github.com/cloudreve/Cloudreve/v3/pkg/hashid"
"github.com/cloudreve/Cloudreve/v3/pkg/serializer"
@@ -137,6 +138,8 @@ func (service *UploadService) SlaveUpload(ctx context.Context, c *gin.Context) s
return serializer.Err(serializer.CodePolicyNotAllowed, err.Error(), err)
}
fs.Handler = local.Driver{}
// 解析需要的参数
service.Index, _ = strconv.Atoi(c.Query("chunk"))
mode := fsctx.Append