stream-worker: honest comment on heartbeat catch (argus nit on #529)
argus pointed out the inline catch comment claimed dead ports get cleaned up on next subscribe, but nothing actually prunes the allPorts Set on subscribe — the honest answer is the one already at the bottom of onconnect: dead entries are left in the Set, the bound cost is acceptable, and postMessage's throw is the ambient signal we use. Point at that comment instead of repeating a wrong description.
This commit is contained in:
parent
b9df538940
commit
88476976b7
1 changed files with 1 additions and 1 deletions
|
|
@ -59,7 +59,7 @@ const PING_INTERVAL_MS = 30_000;
|
|||
setInterval(() => {
|
||||
for (const port of allPorts) {
|
||||
try { port.postMessage({ kind: 'ping' }); }
|
||||
catch { /* port dead — cleanup happens lazily on next subscribe */ }
|
||||
catch { /* port dead — left in the Set; see onconnect's closing comment */ }
|
||||
}
|
||||
}, PING_INTERVAL_MS);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue