gm-plugkit 2.0.1551 → 2.0.1553
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.
- package/package.json +1 -1
- package/plugkit.version +1 -1
- package/supervisor.js +8 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-plugkit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1553",
|
|
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/plugkit.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.645
|
package/supervisor.js
CHANGED
|
@@ -31,6 +31,7 @@ const POLL_INTERVAL_MS = 10_000;
|
|
|
31
31
|
const STATUS_STALE_MS = 30_000;
|
|
32
32
|
const MAX_RESTART_BURST = 5;
|
|
33
33
|
const RESTART_WINDOW_MS = 60_000;
|
|
34
|
+
const BURST_BACKOFF_MS = 60_000;
|
|
34
35
|
|
|
35
36
|
function logEvent(event, fields) {
|
|
36
37
|
try {
|
|
@@ -155,15 +156,18 @@ function spawnWatcher(bootReason) {
|
|
|
155
156
|
restartTimestamps.push(Date.now());
|
|
156
157
|
restartTimestamps = restartTimestamps.filter(t => Date.now() - t < RESTART_WINDOW_MS);
|
|
157
158
|
if (restartTimestamps.length > MAX_RESTART_BURST) {
|
|
158
|
-
logEvent('supervisor.
|
|
159
|
+
logEvent('supervisor.restart-burst-backoff', {
|
|
159
160
|
reason: 'restart-burst-exceeded',
|
|
160
161
|
restarts_in_window: restartTimestamps.length,
|
|
161
162
|
window_ms: RESTART_WINDOW_MS,
|
|
162
163
|
max: MAX_RESTART_BURST,
|
|
163
|
-
|
|
164
|
+
backoff_ms: BURST_BACKOFF_MS,
|
|
165
|
+
severity: 'warn',
|
|
164
166
|
});
|
|
165
|
-
writeSupervisorStatus('
|
|
166
|
-
|
|
167
|
+
writeSupervisorStatus('backoff', { reason: 'restart-burst-exceeded', backoff_ms: BURST_BACKOFF_MS });
|
|
168
|
+
restartTimestamps = [];
|
|
169
|
+
setTimeout(() => spawnWatcher('post-burst-backoff'), BURST_BACKOFF_MS);
|
|
170
|
+
return;
|
|
167
171
|
}
|
|
168
172
|
|
|
169
173
|
const primaryWrapper = path.join(os.homedir(), '.gm-tools', 'plugkit-wasm-wrapper.js');
|