node-automator 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,7 +48,10 @@ class AliOssCommand extends BaseCommand {
48
48
  case "DOWNLOAD": {
49
49
  let src = this.selfData.src;
50
50
  let dst = get_full_path(this.selfData.dst);
51
- client.get(src, dst).then((result) => {
51
+ let timeout = this.selfData.options && this.selfData.options.timeout || 1000 * 60 * 2;
52
+ client.get(src, dst, {
53
+ timeout,
54
+ }).then((result) => {
52
55
  resolve(result);
53
56
  }).catch((err) => {
54
57
  reject(err);
@@ -59,9 +62,12 @@ class AliOssCommand extends BaseCommand {
59
62
  case "UPLOAD": {
60
63
  let dst = this.selfData.dst;
61
64
  let src = get_full_path(this.selfData.src);
65
+ let timeout = this.selfData.options && this.selfData.options.timeout || 1000 * 60 * 2;
62
66
  info("");
63
67
  info(`开始上传 ${path.basename(src)} 到 ${dst}`);
64
- client.put(dst, src).then((result) => {
68
+ client.put(dst, src, {
69
+ timeout,
70
+ }).then((result) => {
65
71
  resolve(result);
66
72
  })
67
73
  .catch((err) => {
@@ -72,6 +78,7 @@ class AliOssCommand extends BaseCommand {
72
78
  case "UPLOAD_FILES": {
73
79
  let dst_folder = this.selfData.dst;
74
80
  let concurrency = this.selfData.options && this.selfData.options.concurrency || 10;
81
+ let timeout = this.selfData.options && this.selfData.options.timeout || 1000 * 60 * 2;
75
82
  let base = this.selfData.base;
76
83
  whisper(`在 ${base} 中收集要上传的文件...`, undefined, true);
77
84
  let srcs = get_file_list(this.selfData.src, undefined, true);
@@ -80,7 +87,9 @@ class AliOssCommand extends BaseCommand {
80
87
  function uploadFiles(srcs) {
81
88
  let tasks = srcs.map((src) => {
82
89
  let dst = path.join(dst_folder, path.relative(base, src)).replace(/\\/g, "/")
83
- return client.put.bind(client, dst, src);
90
+ return client.put.bind(client, dst, src, {
91
+ timeout,
92
+ });
84
93
  });
85
94
  queueAsync(tasks, concurrency, (done, total, index, indexDone) => {
86
95
  progress(done, total, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-automator",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Execute automation with yaml configuration(compatible with json)",
5
5
  "main": "index.js",
6
6
  "repository": {