perf: extract fs func and add error log

This commit is contained in:
Noah Hsu
2022-06-23 23:03:11 +08:00
parent 40b7ecc845
commit 956a5ae906
9 changed files with 185 additions and 92 deletions

View File

@ -3,7 +3,6 @@ package fs
import (
"context"
"fmt"
"github.com/alist-org/alist/v3/internal/driver"
"github.com/alist-org/alist/v3/internal/errs"
"github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/internal/operations"
@ -17,7 +16,7 @@ var UploadTaskManager = task.NewTaskManager[uint64](3, func(tid *uint64) {
})
// Put add as a put task
func Put(ctx context.Context, account driver.Driver, dstDirPath string, file model.FileStreamer) error {
func put(ctx context.Context, dstDirPath string, file model.FileStreamer) error {
account, dstDirActualPath, err := operations.GetAccountAndActualPath(dstDirPath)
if account.Config().NoUpload {
return errors.WithStack(errs.UploadNotSupported)