Skip to content

Commit 2d3f25d

Browse files
committed
Prune expired entries from webPortProbeCache during cache reads
1 parent bc30ac5 commit 2d3f25d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

apps/server/src/terminal/Layers/Manager.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,12 @@ export const makeTerminalManagerWithOptions = Effect.fn("makeTerminalManagerWith
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,

0 commit comments

Comments
 (0)