tycono 0.1.99 → 0.1.100
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
CHANGED
|
@@ -539,6 +539,20 @@ class ExecutionManager {
|
|
|
539
539
|
console.log(`[ExecMgr] Released ports for ${execution.id}: API :${execution.ports.api}, Vite :${execution.ports.vite}`);
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
+
|
|
543
|
+
// Memory cleanup: remove completed execution after 60s
|
|
544
|
+
// Keep briefly for status queries, then GC
|
|
545
|
+
setTimeout(() => {
|
|
546
|
+
this.executions.delete(execution.id);
|
|
547
|
+
// Clean up any leaked sessionMsgContent
|
|
548
|
+
if (execution.sessionId) {
|
|
549
|
+
for (const key of this.sessionMsgContent.keys()) {
|
|
550
|
+
if (key.startsWith(execution.sessionId + ':')) {
|
|
551
|
+
this.sessionMsgContent.delete(key);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}, 60_000);
|
|
542
556
|
});
|
|
543
557
|
}
|
|
544
558
|
|
|
@@ -251,6 +251,13 @@ export function updateSession(id: string, updates: Partial<Pick<Session, 'title'
|
|
|
251
251
|
if (updates.waveId !== undefined) session.waveId = updates.waveId;
|
|
252
252
|
session.updatedAt = new Date().toISOString();
|
|
253
253
|
writeImmediate(session);
|
|
254
|
+
|
|
255
|
+
// Memory: evict done/interrupted sessions from cache after write
|
|
256
|
+
// They're persisted to disk and can be re-loaded on demand
|
|
257
|
+
if (session.status === 'done' || session.status === 'interrupted') {
|
|
258
|
+
setTimeout(() => { cache.delete(id); }, 30_000);
|
|
259
|
+
}
|
|
260
|
+
|
|
254
261
|
return session;
|
|
255
262
|
}
|
|
256
263
|
|
|
@@ -222,6 +222,12 @@ class WaveMultiplexer {
|
|
|
222
222
|
this.registerSession(waveId, execution);
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
/** Remove completed wave sessions from memory */
|
|
226
|
+
cleanupWave(waveId: string): void {
|
|
227
|
+
this.waveSessions.delete(waveId);
|
|
228
|
+
this.clients.delete(waveId);
|
|
229
|
+
}
|
|
230
|
+
|
|
225
231
|
detach(waveId: string, client: WaveStreamClient): void {
|
|
226
232
|
client.closed = true;
|
|
227
233
|
clearInterval(client.heartbeat);
|