Skip to content

Commit 1f5cc90

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Fix timeout error caused by oversimplification of 'onData'
1 parent bf6d8e7 commit 1f5cc90

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

extensions/ql-vscode/src/variant-analysis/view-autofixes.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,11 @@ async function downloadPublicCommitSource(
469469
);
470470

471471
// Set timeout
472-
const { signal, dispose: disposeTimeout } =
473-
createTimeoutSignal(downloadTimeout());
472+
const {
473+
signal,
474+
onData,
475+
dispose: disposeTimeout,
476+
} = createTimeoutSignal(downloadTimeout());
474477

475478
// Fetch the url
476479
let response: Response;
@@ -516,6 +519,7 @@ async function downloadPublicCommitSource(
516519
try {
517520
const readable = Readable.fromWeb(body);
518521
readable.on("data", (chunk) => {
522+
onData();
519523
reportProgress(chunk?.length ?? 0);
520524
});
521525
await new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)