@nger/fk-upload 1.0.117 → 1.0.120

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.
@@ -130,6 +130,7 @@ let FkService = class FkService {
130
130
  let index = task.index || 0;
131
131
  do {
132
132
  let start = index * task.splitSize;
133
+ console.log(`upload ----- `, { index, max, start });
133
134
  if (start >= max) {
134
135
  break;
135
136
  }
@@ -169,6 +170,7 @@ let FkService = class FkService {
169
170
  });
170
171
  if (!uploadResult) {
171
172
  complete = true;
173
+ index = 0;
172
174
  break;
173
175
  }
174
176
  if (uploadResult.code !== 200) {
@@ -193,9 +195,9 @@ let FkService = class FkService {
193
195
  task.uploadUrl = fullUrl;
194
196
  }
195
197
  }
196
- // console.log(`uploading ${task.filename} ${Math.floor((index + 1 / task.totalChunks))}%`)
197
198
  index = index + 1;
198
199
  } while (!complete);
200
+ console.log(`uploading ${task.filename} ${task.uploadUrl}`);
199
201
  index = 0;
200
202
  // upload complete
201
203
  axios_1.default.post(`https://smr00.vip.webportal.top/ajax/advanceUpload.jsp?cmd=_report&_TOKEN=${task.token}`, this.encodeURIComponent({
@@ -50,7 +50,7 @@ class UploadTask extends rabbitmq_1.Task {
50
50
  await complete();
51
51
  return next && next();
52
52
  }
53
- console.log(`receive upload task`, task.filename);
53
+ console.log(`receive upload task`, { filename: task.filename, status: old.status });
54
54
  if (old.status == 1) {
55
55
  // upload
56
56
  await fk.startUploadFile(task).then(async (res) => {
@@ -69,6 +69,7 @@ class UploadTask extends rabbitmq_1.Task {
69
69
  return complete();
70
70
  }
71
71
  this.errorCount += 1;
72
+ console.log(`upload error ${this.errorCount}`, e);
72
73
  throw e;
73
74
  });
74
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nger/fk-upload",
3
- "version": "1.0.117",
3
+ "version": "1.0.120",
4
4
  "description": "",
5
5
  "main": "dist/core.js",
6
6
  "types": "dist/core.d.ts",