bulltrackers-module 1.0.707 → 1.0.709
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview Executor for "Standard" (User-Level) calculations.
|
|
3
3
|
* REFACTORED: Hoisted data loading, centralized Series/Root logic.
|
|
4
4
|
* UPDATED: Calls getResult() on computations to trigger summary logging.
|
|
5
|
-
* FIXED:
|
|
5
|
+
* FIXED: Removed redundant shard index increment that caused shard gaps (0, 2, 4...).
|
|
6
6
|
*/
|
|
7
7
|
const { normalizeName, getEarliestDataDates } = require('../utils/utils');
|
|
8
8
|
const { streamPortfolioData, streamHistoryData, getPortfolioPartRefs, getHistoryPartRefs } = require('../utils/data_loader');
|
|
@@ -279,7 +279,7 @@ class StandardExecutor {
|
|
|
279
279
|
data = inst.results || {};
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
// Track active calculations
|
|
282
|
+
// Track active calculations (for debugging/logging only now)
|
|
283
283
|
if (Object.keys(data).length > 0) {
|
|
284
284
|
activeCalcs.push(name);
|
|
285
285
|
}
|
|
@@ -302,16 +302,10 @@ class StandardExecutor {
|
|
|
302
302
|
|
|
303
303
|
const res = await commitResults(transformedState, dateStr, passName, config, deps, skipStatus, { flushMode: mode, shardIndexes: shardMap, isInitialWrite: isInitial });
|
|
304
304
|
|
|
305
|
-
// Update shardMap from result
|
|
305
|
+
// Update shardMap from result.
|
|
306
|
+
// ResultCommitter now returns the CORRECT nextShardIndex (e.g. if it wrote shard_0, it returns 1).
|
|
306
307
|
if (res.shardIndexes) Object.assign(shardMap, res.shardIndexes);
|
|
307
308
|
|
|
308
|
-
// [FIX 2] Force increment shard indexes for active calculations.
|
|
309
|
-
// This ensures the NEXT batch writes to a NEW shard (e.g. results_1)
|
|
310
|
-
// instead of overwriting the current one (results_0).
|
|
311
|
-
activeCalcs.forEach(name => {
|
|
312
|
-
shardMap[name] = (shardMap[name] || 0) + 1;
|
|
313
|
-
});
|
|
314
|
-
|
|
315
309
|
return res;
|
|
316
310
|
}
|
|
317
311
|
|