@forzalabs/remora 1.0.9 → 1.0.10

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.
@@ -62,6 +62,7 @@ class ExecutorOrchestratorClass {
62
62
  this.init();
63
63
  const executorResults = [];
64
64
  const sourceFilesByProducer = yield this.readySourceFiles(consumer);
65
+ let globalWorkerIndex = 0;
65
66
  for (const pair of sourceFilesByProducer) {
66
67
  const { prod, cProd, response } = pair;
67
68
  // Make sure that the data files are there, if missing and isOptional = true, then skip
@@ -78,9 +79,11 @@ class ExecutorOrchestratorClass {
78
79
  for (const file of response.files) {
79
80
  const chunks = ExecutorOrchestrator.scopeWork(file.fullUri);
80
81
  const workerThreads = [];
81
- for (const [index, chunk] of chunks.entries()) {
82
+ for (const chunk of chunks) {
82
83
  // Spawn off thread
83
- const workerId = `${usageId}_${index}`;
84
+ const workerId = `${usageId}_${globalWorkerIndex}`;
85
+ const currentWorkerIndex = globalWorkerIndex;
86
+ globalWorkerIndex++;
84
87
  const workerData = {
85
88
  chunk,
86
89
  consumer,
@@ -89,10 +92,10 @@ class ExecutorOrchestratorClass {
89
92
  workerId: workerId,
90
93
  options: options
91
94
  };
92
- _progress.register((index + 1).toString());
95
+ _progress.register((currentWorkerIndex + 1).toString());
93
96
  workersId.push(workerId);
94
97
  workerThreads.push(this._executorPool.exec('executor', [workerData], {
95
- on: payload => this.onWorkAdvanced(payload, index, _progress)
98
+ on: payload => this.onWorkAdvanced(payload, currentWorkerIndex, _progress)
96
99
  }));
97
100
  }
98
101
  executorResults.push(...yield Promise.all(workerThreads));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forzalabs/remora",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "A powerful CLI tool for seamless data translation.",
5
5
  "main": "index.js",
6
6
  "private": false,