gm-plugkit 2.0.1553 → 2.0.1554

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/supervisor.js +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1553",
3
+ "version": "2.0.1554",
4
4
  "description": "Bootstrap and daemon-spawn tool for gm plugkit binary. Downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Includes plugkit-wasm-wrapper for WASM-based spool watching.",
5
5
  "main": "index.js",
6
6
  "bin": {
package/supervisor.js CHANGED
@@ -32,6 +32,7 @@ const STATUS_STALE_MS = 30_000;
32
32
  const MAX_RESTART_BURST = 5;
33
33
  const RESTART_WINDOW_MS = 60_000;
34
34
  const BURST_BACKOFF_MS = 60_000;
35
+ const VERSION_DRIFT_COOLDOWN_MS = 60_000;
35
36
 
36
37
  function logEvent(event, fields) {
37
38
  try {
@@ -147,6 +148,7 @@ function readShutdownReason() {
147
148
  }
148
149
 
149
150
  let lastSpawnedAt = 0;
151
+ let lastVersionDriftActionAt = 0;
150
152
  let restartTimestamps = [];
151
153
  let currentChildPid = null;
152
154
  let currentBootReason = 'initial';
@@ -341,10 +343,15 @@ function checkWatcherHealth() {
341
343
  // On that drift, evict the stale cached wasm so the next bootstrap fails isReady() and
342
344
  // redownloads the correct build, then recycle the child to load it.
343
345
  if (status.version_drifted === true) {
346
+ if (now - lastVersionDriftActionAt < VERSION_DRIFT_COOLDOWN_MS) {
347
+ return;
348
+ }
349
+ lastVersionDriftActionAt = now;
344
350
  logEvent('supervisor.version-drift', {
345
351
  watcher_pid: currentChildPid,
346
352
  instance_version: status.instance_version || null,
347
353
  file_version: status.file_version || null,
354
+ cooldown_ms: VERSION_DRIFT_COOLDOWN_MS,
348
355
  severity: 'critical',
349
356
  });
350
357
  try {