Remove locked assets from shares

This commit is contained in:
Alan Grainger
2026-10-07 18:08:12 +13:00
parent 172f247418
commit 285d48e9d0
8 changed files with 69 additions and 19 deletions
+3 -6
View File
@@ -6,12 +6,9 @@ export class IdleTimeoutError extends Error {}
/**
* A pass-through Transform that destroys itself when fewer than `minBytes`
* flow through it in any `idleMs` interval. The check is armed when the
* transform is created, so a body that never starts also times out.
*
* With `minBytes` left at 1 this is a plain idle timeout: a slow-but-steady
* stream keeps going, a stalled one fails. A higher `minBytes` is a floor on
* throughput, which stops a trickle of one byte a minute holding the
* resources an upload reserved for as long as the sender likes.
* transform is created, so a body that never starts also times out. With
* `minBytes` left at 1 this is a plain idle timeout; a higher value is a
* floor on throughput.
*/
export function createIdleTimeoutStream (idleMs: number, minBytes = 1): Transform {
let received = 0