bulltrackers-module 1.0.704 → 1.0.705
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Executor for "Standard" (User-Level) calculations.
|
|
3
3
|
* REFACTORED: Hoisted data loading, centralized Series/Root logic.
|
|
4
|
+
* UPDATED: Calls getResult() on computations to trigger summary logging and finalization logic.
|
|
4
5
|
*/
|
|
5
6
|
const { normalizeName, getEarliestDataDates } = require('../utils/utils');
|
|
6
7
|
const { streamPortfolioData, streamHistoryData, getPortfolioPartRefs, getHistoryPartRefs } = require('../utils/data_loader');
|
|
@@ -269,7 +270,14 @@ class StandardExecutor {
|
|
|
269
270
|
static async flushBuffer(state, dateStr, passName, config, deps, shardMap, stats, mode, skipStatus, isInitial) {
|
|
270
271
|
const transformedState = {};
|
|
271
272
|
for (const [name, inst] of Object.entries(state)) {
|
|
272
|
-
|
|
273
|
+
// [FIX] Prefer getResult() to allow computation to perform finalization/logging
|
|
274
|
+
let data;
|
|
275
|
+
if (typeof inst.getResult === 'function') {
|
|
276
|
+
data = await inst.getResult();
|
|
277
|
+
} else {
|
|
278
|
+
data = inst.results || {};
|
|
279
|
+
}
|
|
280
|
+
|
|
273
281
|
// Pivot user-date structure if needed
|
|
274
282
|
const first = Object.keys(data)[0];
|
|
275
283
|
if (first && data[first] && typeof data[first] === 'object' && /^\d{4}-\d{2}-\d{2}$/.test(Object.keys(data[first])[0])) {
|