diff --git a/internal/syncdrive/file_action_task.go b/internal/syncdrive/file_action_task.go index aeebf39..707c816 100644 --- a/internal/syncdrive/file_action_task.go +++ b/internal/syncdrive/file_action_task.go @@ -444,6 +444,7 @@ func (f *FileActionTask) uploadFile(ctx context.Context) error { // 尝试创建文件夹 panDirPath := filepath.Dir(targetPanFilePath) panDirFileId := "" + logger.Verbosef("检测云盘文件夹: %s\n", panDirPath) if dirFile, er2 := f.panClient.OpenapiPanClient().FileInfoByPath(f.syncItem.DriveId, panDirPath); er2 != nil { if er2.Code == apierror.ApiCodeFileNotFoundCode { logger.Verbosef("创建云盘文件夹: %s\n", panDirPath) @@ -456,7 +457,7 @@ func (f *FileActionTask) uploadFile(ctx context.Context) error { panDirFileId = rs.FileId logger.Verbosef("创建云盘文件夹成功: %s\n", panDirPath) } else { - logger.Verbosef("创建云盘文件夹错误: %s\n", er2.String()) + logger.Verbosef("查询云盘文件夹错误: %s\n", er2.String()) return er2 } } else { diff --git a/internal/syncdrive/file_action_task_mgr.go b/internal/syncdrive/file_action_task_mgr.go index 7e5f83e..a89028e 100644 --- a/internal/syncdrive/file_action_task_mgr.go +++ b/internal/syncdrive/file_action_task_mgr.go @@ -494,6 +494,7 @@ func (f *FileActionTaskManager) fileActionTaskExecutor(ctx context.Context) { // cancel routine & done logger.Verboseln("file executor routine done") downloadWaitGroup.Wait() + uploadWaitGroup.Wait() return default: actionIsEmptyOfThisTerm := true diff --git a/internal/syncdrive/sync_db.go b/internal/syncdrive/sync_db.go index a9f38c8..8a5ed51 100644 --- a/internal/syncdrive/sync_db.go +++ b/internal/syncdrive/sync_db.go @@ -348,7 +348,8 @@ func (item *SyncFileItem) getPanFileFullPath() string { localRootPath := strings.ReplaceAll(item.LocalFolderPath, "\\", "/") relativePath := strings.TrimPrefix(localPath, localRootPath) - return path.Join(path.Clean(item.PanFolderPath), relativePath) + panPath := path.Join(path.Clean(item.PanFolderPath), relativePath) + return strings.ReplaceAll(panPath, "\\", "/") } // getLocalFullPath 获取本地文件的路径 diff --git a/internal/syncdrive/utils.go b/internal/syncdrive/utils.go index 8c83c7e..249f1c9 100644 --- a/internal/syncdrive/utils.go +++ b/internal/syncdrive/utils.go @@ -13,7 +13,8 @@ func GetPanFileFullPathFromLocalPath(localFilePath, localRootPath, panRootPath s localRootPath = strings.ReplaceAll(localRootPath, "\\", "/") relativePath := strings.TrimPrefix(localFilePath, localRootPath) - return path.Join(path.Clean(panRootPath), relativePath) + panPath := path.Join(path.Clean(panRootPath), relativePath) + return strings.ReplaceAll(panPath, "\\", "/") } // GetLocalFileFullPathFromPanPath 获取本地文件的路径