File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/variant-analysis Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ import {
7575 writeRepoStates ,
7676} from "./repo-states-store" ;
7777import { GITHUB_AUTH_PROVIDER_ID } from "../common/vscode/authentication" ;
78+ import { FetchError } from "node-fetch" ;
7879
7980export class VariantAnalysisManager
8081 extends DisposableObject
@@ -613,12 +614,27 @@ export class VariantAnalysisManager
613614 } ) ;
614615 }
615616 } ;
616- await this . variantAnalysisResultsManager . download (
617- variantAnalysis . id ,
618- repoTask ,
619- this . getVariantAnalysisStorageLocation ( variantAnalysis . id ) ,
620- updateRepoStateCallback ,
621- ) ;
617+ let retry = 0 ;
618+ for ( ; ; ) {
619+ try {
620+ await this . variantAnalysisResultsManager . download (
621+ variantAnalysis . id ,
622+ repoTask ,
623+ this . getVariantAnalysisStorageLocation ( variantAnalysis . id ) ,
624+ updateRepoStateCallback ,
625+ ) ;
626+ break ;
627+ } catch ( e ) {
628+ if (
629+ retry ++ < 3 &&
630+ e instanceof FetchError &&
631+ ( e . code === "ETIMEDOUT" || e . code === "ECONNRESET" )
632+ ) {
633+ continue ;
634+ }
635+ throw e ;
636+ }
637+ }
622638 } catch ( e ) {
623639 repoState . downloadStatus =
624640 VariantAnalysisScannedRepositoryDownloadStatus . Failed ;
You can’t perform that action at this time.
0 commit comments