Skip to content

Add sync support#311

Merged
SquatsTonight merged 21 commits into
alibaba:tanhehe/add_fun_sync_supportfrom
SquatsTonight:add_sync_support
Aug 4, 2019
Merged

Add sync support#311
SquatsTonight merged 21 commits into
alibaba:tanhehe/add_fun_sync_supportfrom
SquatsTonight:add_sync_support

Conversation

@SquatsTonight
Copy link
Copy Markdown
Collaborator

@SquatsTonight SquatsTonight commented Aug 4, 2019

fun nas sync

  1. 成功上传
  • 压缩进度
> fun nas sync
Starting upload /Users/zqf/Documents/fun-nas-test/.fun/nas/372784bc17-hlf61.cn-shanghai.nas.aliyuncs.com/fun-nas-test/ to nas://fun-nas-test:/mnt/naser/
NAS path checking...
zipping /Users/zqf/Documents/fun-nas-test/.fun/nas/372784bc17-hlf61.cn-shanghai.nas.aliyuncs.com/fun-nas-test/
:zipping █████████████████████ 530/13104 137 files/s, 4% 91.5s
  • 上传进度
Starting upload /Users/zqf/Documents/fun-nas-test/.fun/nas/372784bc17-hlf61.cn-shanghai.nas.aliyuncs.com/fun-nas-test/ to nas://fun-nas-test:/mnt/naser/
NAS path checking...
zipping /Users/zqf/Documents/fun-nas-test/.fun/nas/372784bc17-hlf61.cn-shanghai.nas.aliyuncs.com/fun-nas-test/
✔ /Users/zqf/Documents/fun-nas-test/.fun/nas/372784bc17-hlf61.cn-shanghai.nas.aliyuncs.com/.fun-nas-test.zip - zipped
generate tmpDir: /Users/zqf/Documents/fun-nas-test/.fun/nas/372784bc17-hlf61.cn-shanghai.nas.aliyuncs.com/.fun_nas_tmp/4625961113de47ddae98b2483a95f895
Split zip file to 29 small files
Uploading split files...
:uploading █████████████████████ 21/29 1 files/s, 72% 6.8s
  • 上传成功
> fun nas sync
NAS path checking...
zipping /Users/zqf/Documents/fun-nas-test/.fun/nas/372784bc17-hlf61.cn-shanghai.nas.aliyuncs.com/fun-nas-test/
✔ /Users/zqf/Documents/fun-nas-test/.fun/nas/372784bc17-hlf61.cn-shanghai.nas.aliyuncs.com/.fun-nas-test.zip - zipped
generate tmpDir: /Users/zqf/Documents/fun-nas-test/.fun/nas/372784bc17-hlf61.cn-shanghai.nas.aliyuncs.com/.fun_nas_tmp/1713577f74847064b86cbc61cdb2341a
Split zip file to 29 small files
Uploading split files...
✔ files uploaded
Upload /Users/zqf/Documents/fun-nas-test/.fun/nas/372784bc17-hlf61.cn-shanghai.nas.aliyuncs.com/fun-nas-test/ to /mnt/naser/ done!

Tips for next step
======================
$ fun nas info      # Show NAS info
$ fun nas ls        # List NAS files
$ fun nas sync      # Synchronize files to nas
$ fun deploy        # Deploy Resources

Comment thread lib/fc-utils/fc-fun-nas-server/index.js Outdated

const uploadedSplitFiles = await filesNameAndHash(tmpDir);

const uploadedSplitFilesJson = mapToJson(uploadedSplitFiles);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为啥要转成 string?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为http传输无法传输map结构,只能转成json string后传输,然后在本地会执行json.parse将其转换为object格式

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那为啥不一开始直接用 json

Comment thread lib/nas/cp/upload.js Outdated
console.log(`Upload ${srcPath} to ${dstPath} done!`);

tips.showInitNextTips();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

放在 if 外面,写一次就好了

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread lib/nas/path.js Outdated
Comment thread lib/fc-utils/fc-fun-nas-server/index.js Outdated
Comment thread lib/fc-utils/fc-fun-nas-server/lib/path.js Outdated
Comment thread lib/nas/cp/upload.js Outdated
Comment thread lib/nas/path.js Outdated
Comment thread lib/fc-utils/fc-fun-nas-server/lib/path.js Outdated
@SquatsTonight SquatsTonight merged commit f3dd226 into alibaba:tanhehe/add_fun_sync_support Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants