History

Prune expired entries from webPortProbeCache during cache reads

Cursor Agent committed 7 months ago

Commit 2d3f25d1 parent bc30ac51 file · +6 −0Browse files

Unified · Split

apps/server/src/terminal/Layers/Manager.ts+6−0
@@ -613,6 +613,12 @@ export const makeTerminalManagerWithOptions = Effect.fn("makeTerminalManagerWith · 612 unmodified lines
613613 return cached.isWeb;
614614 }
615615
616+ for (const [p, entry] of webPortProbeCache) {
617+ if (now - entry.checkedAt > webPortProbeCacheTtlMs) {
618+ webPortProbeCache.delete(p);
619+ }
620+ }
621+
616622 const isWeb = yield* webPortInspector(port).pipe(Effect.catch(() => Effect.succeed(false)));
617623 webPortProbeCache.set(port, {
618624 isWeb,