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
613 return cached.isWeb;613 return cached.isWeb;
614 }614 }
615 615
616 for (const [p, entry] of webPortProbeCache) {
617 if (now - entry.checkedAt > webPortProbeCacheTtlMs) {
618 webPortProbeCache.delete(p);
619 }
620 }
621
616 const isWeb = yield* webPortInspector(port).pipe(Effect.catch(() => Effect.succeed(false)));622 const isWeb = yield* webPortInspector(port).pipe(Effect.catch(() => Effect.succeed(false)));
617 webPortProbeCache.set(port, {623 webPortProbeCache.set(port, {
618 isWeb,624 isWeb,