bulltrackers-module 1.0.366 → 1.0.367

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.
@@ -273,10 +273,20 @@ async function handleSweepDispatch(config, dependencies, computationManifest, re
273
273
  if (doc.exists) {
274
274
  const data = doc.data();
275
275
 
276
- // 1. ACTIVE CHECK: Don't double-dispatch if already running
276
+ // 1. ACTIVE CHECK: Don't double-dispatch if already running... UNLESS IT'S A ZOMBIE
277
277
  if (['PENDING', 'IN_PROGRESS'].includes(data.status)) {
278
- logger.log('INFO', `[Sweep] Skipping ${name} - Already IN_PROGRESS.`);
279
- continue;
278
+ const lastActivity = data.telemetry?.lastHeartbeat
279
+ ? new Date(data.telemetry.lastHeartbeat).getTime()
280
+ : (data.startedAt ? new Date(data.startedAt).getTime() : 0);
281
+
282
+ // If it's been silent for > 15 mins, it's a Zombie. Kill it and Re-run.
283
+ if ((Date.now() - lastActivity) > STALE_LOCK_THRESHOLD_MS) {
284
+ logger.log('WARN', `[Sweep] 🧟 Found ZOMBIE lock for ${name}. Breaking lock and re-running.`);
285
+ // Don't continue; let it fall through to dispatch
286
+ } else {
287
+ logger.log('INFO', `[Sweep] ⏳ Skipping ${name} - Valid IN_PROGRESS.`);
288
+ continue;
289
+ }
280
290
  }
281
291
 
282
292
  // 2. COMPLETION CHECK (GHOST STATE FIX)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulltrackers-module",
3
- "version": "1.0.366",
3
+ "version": "1.0.367",
4
4
  "description": "Helper Functions for Bulltrackers.",
5
5
  "main": "index.js",
6
6
  "files": [