mcp-tenant-lib 0.3.7 → 0.3.8
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/dist/persistence.js +10 -0
- package/package.json +1 -1
package/dist/persistence.js
CHANGED
|
@@ -94,5 +94,15 @@ export function enablePersistence(filePath) {
|
|
|
94
94
|
writeToDisk();
|
|
95
95
|
}, WRITE_DEBOUNCE_MS);
|
|
96
96
|
pollInterval.unref();
|
|
97
|
+
// A change followed by a kill within WRITE_DEBOUNCE_MS never reaches the
|
|
98
|
+
// poll loop above, so the process's last bit of state would silently be
|
|
99
|
+
// lost on an otherwise-ordinary Ctrl+C. Force one final synchronous write
|
|
100
|
+
// before actually exiting so a quick restart doesn't drop it.
|
|
101
|
+
for (const signal of ['SIGINT', 'SIGTERM']) {
|
|
102
|
+
process.on(signal, () => {
|
|
103
|
+
writeToDisk();
|
|
104
|
+
process.exit(0);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
97
107
|
return { seededIds };
|
|
98
108
|
}
|