@forzalabs/remora 1.0.15 → 1.0.17

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.
@@ -149,11 +149,15 @@ class ConsumerExecutorClass {
149
149
  writer.end();
150
150
  });
151
151
  // Ensure the reader is fully closed before renaming
152
- yield new Promise(resolve => {
153
- reader.once('close', resolve);
154
- reader.destroy();
155
- });
156
- fs_1.default.renameSync(tempWorkPath, datasetPath);
152
+ if (!reader.destroyed) {
153
+ yield new Promise(resolve => {
154
+ reader.once('close', resolve);
155
+ reader.destroy();
156
+ });
157
+ }
158
+ // Delete original file first to avoid EPERM on Windows
159
+ yield promises_1.default.unlink(datasetPath);
160
+ yield promises_1.default.rename(tempWorkPath, datasetPath);
157
161
  return newLineCount;
158
162
  });
159
163
  this.processDistinctOn = (consumer, datasetPath) => __awaiter(this, void 0, void 0, function* () {
@@ -209,11 +213,15 @@ class ConsumerExecutorClass {
209
213
  writer.end();
210
214
  });
211
215
  // Ensure the reader is fully closed before renaming
212
- yield new Promise(resolve => {
213
- reader.once('close', resolve);
214
- reader.destroy();
215
- });
216
- fs_1.default.renameSync(tempWorkPath, datasetPath);
216
+ if (!reader.destroyed) {
217
+ yield new Promise(resolve => {
218
+ reader.once('close', resolve);
219
+ reader.destroy();
220
+ });
221
+ }
222
+ // Delete original file first to avoid EPERM on Windows
223
+ yield promises_1.default.unlink(datasetPath);
224
+ yield promises_1.default.rename(tempWorkPath, datasetPath);
217
225
  return winners.size;
218
226
  });
219
227
  /**
@@ -109,6 +109,8 @@ class ExecutorOrchestratorClass {
109
109
  }
110
110
  }
111
111
  _progress.complete();
112
+ if (executorResults.some(x => !Algo_1.default.hasVal(x)))
113
+ throw new Error(`${executorResults.filter(x => !Algo_1.default.hasVal(x)).length} worker(s) failed to produce valid results`);
112
114
  yield this.reconcileExecutorThreadsResults(scope, executorResults, tracker);
113
115
  // If there is more than one worker, then I need to redo the operations that are done on multiple lines (cause now the worker files have been merged together)
114
116
  const postOperation = { totalOutputCount: null };
@@ -119,7 +121,7 @@ class ExecutorOrchestratorClass {
119
121
  tracker.measure('process-distinct:main', performance.now() - counter);
120
122
  postOperation.totalOutputCount = unifiedOutputCount;
121
123
  }
122
- if (((_b = consumer.options) === null || _b === void 0 ? void 0 : _b.distinct) === true) {
124
+ if ((_b = consumer.options) === null || _b === void 0 ? void 0 : _b.distinctOn) {
123
125
  counter = performance.now();
124
126
  const unifiedOutputCount = yield ConsumerExecutor_1.default.processDistinctOn(consumer, ExecutorScope_1.default.getMainPath(scope));
125
127
  tracker.measure('process-distinct-on:main', performance.now() - counter);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forzalabs/remora",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "A powerful CLI tool for seamless data translation.",
5
5
  "main": "index.js",
6
6
  "private": false,