Skip to content

Commit

Permalink
fix: timeout for betweenBytesTiemout and firstByteTimeout (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored Mar 22, 2024
1 parent bcb28d9 commit 7f91691
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/preview2-shim/lib/io/worker-http.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ export async function createHttpRequest(
req.once("close", () => reject);
req.once("error", reject);
});
if (firstByteTimeout) res.setTimeout(Number(firstByteTimeout));
if (firstByteTimeout) res.setTimeout(Number(firstByteTimeout / 1_000_000n));
if (betweenBytesTimeout)
res.once("readable", () => {
res.setTimeout(Number(betweenBytesTimeout));
res.setTimeout(Number(betweenBytesTimeout / 1_000_000n));
});
const bodyStreamId = createReadableStream(res);
return {
Expand Down

0 comments on commit 7f91691

Please sign in to comment.