bulltrackers-module 1.0.760 → 1.0.762
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,22 +2,26 @@
|
|
|
2
2
|
* @fileoverview Cloud Function Handlers
|
|
3
3
|
*
|
|
4
4
|
* Export handlers for deployment as Cloud Functions:
|
|
5
|
-
* -
|
|
5
|
+
* - computePlanner: Plans root computations into Cloud Tasks
|
|
6
|
+
* - computeWatchdog: Recovers zombies / stuck computations
|
|
6
7
|
* - computeDispatcher: Receives tasks from Cloud Tasks queue
|
|
7
8
|
* - computeOnDemand: Receives requests from frontend
|
|
8
9
|
* - computationWorker: Serverless worker for entity-level computation
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
|
-
const {
|
|
12
|
+
const { planComputations, runWatchdog } = require('./scheduler');
|
|
12
13
|
const { dispatcherHandler } = require('./dispatcher');
|
|
13
14
|
const { onDemandHandler } = require('./onDemand');
|
|
14
15
|
const { workerHandler, executeLocal } = require('./worker');
|
|
15
16
|
const { adminTestHandler } = require('./adminTest');
|
|
16
17
|
|
|
17
18
|
module.exports = {
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
// Planner: projects upcoming root computations into Cloud Tasks
|
|
20
|
+
computePlanner: planComputations,
|
|
21
|
+
|
|
22
|
+
// Watchdog: detects and recovers zombies
|
|
23
|
+
computeWatchdog: runWatchdog,
|
|
24
|
+
|
|
21
25
|
// Main dispatcher - handles scheduled tasks from Cloud Tasks
|
|
22
26
|
computeDispatcher: dispatcherHandler,
|
|
23
27
|
|
|
@@ -58,9 +58,10 @@ async function planComputations(req, res) {
|
|
|
58
58
|
|
|
59
59
|
// 1. Walk the Manifest
|
|
60
60
|
for (const entry of manifest) {
|
|
61
|
-
// FILTER: Only Roots (Pass
|
|
62
|
-
//
|
|
63
|
-
|
|
61
|
+
// FILTER: Only Roots (Pass 1)
|
|
62
|
+
// Graph.js assigns roots (no dependencies) to Pass 1.
|
|
63
|
+
// Resilience: If code changes and a comp becomes Pass 2+, it won't be scheduled here.
|
|
64
|
+
if (entry.pass !== 1) continue;
|
|
64
65
|
|
|
65
66
|
// Calculate Occurrences
|
|
66
67
|
const occurrences = getOccurrencesInWindow(entry.schedule, now, windowEnd);
|