bulltrackers-module 1.0.201 → 1.0.202
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,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* FILENAME: bulltrackers-module/functions/computation-system/helpers/computation_dispatcher.js
|
|
3
3
|
* PURPOSE: Dispatches computation tasks to Pub/Sub for scalable execution.
|
|
4
|
+
* FIXED: Instantiates PubSubUtils locally to ensure valid logger/dependencies are used.
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
const { getExpectedDateStrings } = require('../utils/utils.js');
|
|
7
8
|
const { groupByPass } = require('./orchestration_helpers.js');
|
|
9
|
+
// Import PubSubUtils Class directly to ensure we can instantiate it
|
|
10
|
+
const { PubSubUtils } = require('../../core/utils/pubsub_utils');
|
|
8
11
|
|
|
9
12
|
const TOPIC_NAME = 'computation-tasks';
|
|
10
13
|
|
|
@@ -13,7 +16,13 @@ const TOPIC_NAME = 'computation-tasks';
|
|
|
13
16
|
* Instead of running them, it queues them in Pub/Sub.
|
|
14
17
|
*/
|
|
15
18
|
async function dispatchComputationPass(config, dependencies, computationManifest) {
|
|
16
|
-
const { logger
|
|
19
|
+
const { logger } = dependencies;
|
|
20
|
+
|
|
21
|
+
// --- FIX: Create fresh PubSubUtils instance ---
|
|
22
|
+
// This ensures we use the valid 'dependencies' (with logger & pubsub)
|
|
23
|
+
// passed to this function, rather than relying on a potentially stale injection.
|
|
24
|
+
const pubsubUtils = new PubSubUtils(dependencies);
|
|
25
|
+
|
|
17
26
|
const passToRun = String(config.COMPUTATION_PASS_TO_RUN);
|
|
18
27
|
|
|
19
28
|
if (!passToRun) {
|
|
@@ -79,4 +88,4 @@ async function dispatchComputationPass(config, dependencies, computationManifest
|
|
|
79
88
|
return { dispatched: dispatchedCount };
|
|
80
89
|
}
|
|
81
90
|
|
|
82
|
-
module.exports = { dispatchComputationPass };
|
|
91
|
+
module.exports = { dispatchComputationPass };
|