chore(fs): rename some variable and param
This commit is contained in:
@ -16,8 +16,8 @@ var UploadTaskManager = task.NewTaskManager[uint64, struct{}](3, func(tid *uint6
|
||||
})
|
||||
|
||||
// Put add as a put task
|
||||
func Put(ctx context.Context, account driver.Driver, parentPath string, file model.FileStreamer) error {
|
||||
account, actualParentPath, err := operations.GetAccountAndActualPath(parentPath)
|
||||
func Put(ctx context.Context, account driver.Driver, dstDirPath string, file model.FileStreamer) error {
|
||||
account, dstDirActualPath, err := operations.GetAccountAndActualPath(dstDirPath)
|
||||
if account.Config().NoUpload {
|
||||
return errors.WithStack(ErrUploadNotSupported)
|
||||
}
|
||||
@ -25,9 +25,9 @@ func Put(ctx context.Context, account driver.Driver, parentPath string, file mod
|
||||
return errors.WithMessage(err, "failed get account")
|
||||
}
|
||||
UploadTaskManager.Submit(task.WithCancelCtx(&task.Task[uint64, struct{}]{
|
||||
Name: fmt.Sprintf("upload %s to [%s](%s)", file.GetName(), account.GetAccount().VirtualPath, actualParentPath),
|
||||
Name: fmt.Sprintf("upload %s to [%s](%s)", file.GetName(), account.GetAccount().VirtualPath, dstDirActualPath),
|
||||
Func: func(task *task.Task[uint64, struct{}]) error {
|
||||
return operations.Put(task.Ctx, account, actualParentPath, file, nil)
|
||||
return operations.Put(task.Ctx, account, dstDirActualPath, file, nil)
|
||||
},
|
||||
}))
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user