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:
@@ -117,16 +117,18 @@ func (job *TransferTask) Do() {
|
||||
}
|
||||
|
||||
// 切换为从机节点处理上传
|
||||
fs.SetPolicyFromPath(path.Dir(dst))
|
||||
fs.SwitchToSlaveHandler(node)
|
||||
err = fs.UploadFromStream(context.Background(), &fsctx.FileStream{
|
||||
File: nil,
|
||||
Size: job.TaskProps.SrcSizes[file],
|
||||
Name: path.Base(dst),
|
||||
VirtualPath: path.Dir(dst),
|
||||
})
|
||||
Src: file,
|
||||
}, false)
|
||||
} else {
|
||||
// 主机节点中转
|
||||
err = fs.UploadFromPath(context.Background(), file, dst, true, 0)
|
||||
err = fs.UploadFromPath(context.Background(), file, dst, 0)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user