fix(gateway): implement gateway watchdog, socket close tracking, and self-healing reconnects (#12)

This commit is contained in:
NoLogicAlan committed 2026-11-04 01:30:33 +03:00
1 parent 08634adb88
commit 26aed399fc
3 files changed
+94 -4

No files matched your search

+5 -1
View File
@@ -128,10 +128,14 @@ manager.on("error", (err) => {
logger.error("[Sharding] Manager error:", err?.message ?? err);
});
// Event loop health heartbeat for Docker container healthcheck (Issue #12)
/* Event loop health heartbeat for Docker container healthcheck (Issue #12) */
const healthFile = path.join(os.tmpdir(), ".remix-health");
const updateHealth = () => {
try {
if (manager.shards && manager.shards.size > 0) {
const anyAlive = [...manager.shards.values()].some(s => s.process && !s.process.killed);
if (!anyAlive) return;
}
fs.writeFile(healthFile, Date.now().toString(), () => {});
} catch (_) {}
};