@@ -205,6 +205,7 @@ class DTSManager {
205205
206206 async requestRemoteManifest (
207207 remoteInfo : RemoteInfo ,
208+ hostOptions : Required < HostOptions > ,
208209 ) : Promise < Required < RemoteInfo > > {
209210 try {
210211 if ( ! remoteInfo . url . includes ( MANIFEST_EXT ) ) {
@@ -214,7 +215,7 @@ class DTSManager {
214215 return remoteInfo as Required < RemoteInfo > ;
215216 }
216217 const url = remoteInfo . url ;
217- const res = await axiosGet ( url ) ;
218+ const res = await axiosGet ( url , { timeout : hostOptions . timeout } ) ;
218219 const manifestJson = res . data as unknown as Manifest ;
219220 if ( ! manifestJson . metaData . types . zip ) {
220221 throw new Error ( `Can not get ${ remoteInfo . name } 's types archive url!` ) ;
@@ -280,14 +281,15 @@ class DTSManager {
280281 async downloadAPITypes (
281282 remoteInfo : Required < RemoteInfo > ,
282283 destinationPath : string ,
284+ hostOptions : Required < HostOptions > ,
283285 ) {
284286 const { apiTypeUrl } = remoteInfo ;
285287 if ( ! apiTypeUrl ) {
286288 return ;
287289 }
288290 try {
289291 const url = apiTypeUrl ;
290- const res = await axiosGet ( url ) ;
292+ const res = await axiosGet ( url , { timeout : hostOptions . timeout } ) ;
291293 let apiTypeFile = res . data as string ;
292294 apiTypeFile = apiTypeFile . replaceAll (
293295 REMOTE_ALIAS_IDENTIFIER ,
@@ -389,8 +391,10 @@ class DTSManager {
389391 async ( item ) => {
390392 const remoteInfo = item [ 1 ] ;
391393 if ( ! this . remoteAliasMap [ remoteInfo . alias ] ) {
392- const requiredRemoteInfo =
393- await this . requestRemoteManifest ( remoteInfo ) ;
394+ const requiredRemoteInfo = await this . requestRemoteManifest (
395+ remoteInfo ,
396+ hostOptions ,
397+ ) ;
394398 this . remoteAliasMap [ remoteInfo . alias ] = requiredRemoteInfo ;
395399 }
396400
@@ -434,7 +438,11 @@ class DTSManager {
434438 return ;
435439 }
436440
437- await this . downloadAPITypes ( remoteInfo , destinationPath ) ;
441+ await this . downloadAPITypes (
442+ remoteInfo ,
443+ destinationPath ,
444+ hostOptions ,
445+ ) ;
438446 } ) ,
439447 ) ;
440448 this . consumeAPITypes ( hostOptions ) ;
@@ -507,6 +515,7 @@ class DTSManager {
507515 const addNew = await this . downloadAPITypes (
508516 requiredRemoteInfo ,
509517 destinationPath ,
518+ hostOptions ,
510519 ) ;
511520 if ( addNew ) {
512521 this . consumeAPITypes ( hostOptions ) ;
@@ -531,8 +540,10 @@ class DTSManager {
531540 ) ;
532541 if ( remoteInfo ) {
533542 if ( ! this . remoteAliasMap [ remoteInfo . alias ] ) {
534- const requiredRemoteInfo =
535- await this . requestRemoteManifest ( remoteInfo ) ;
543+ const requiredRemoteInfo = await this . requestRemoteManifest (
544+ remoteInfo ,
545+ hostOptions ,
546+ ) ;
536547 this . remoteAliasMap [ remoteInfo . alias ] = requiredRemoteInfo ;
537548 }
538549 await consumeTypes ( this . remoteAliasMap [ remoteInfo . alias ] ) ;
@@ -550,7 +561,7 @@ class DTSManager {
550561 } ) ;
551562 fileLog ( `start request manifest` , 'consumeTypes' , 'info' ) ;
552563 this . updatedRemoteInfos [ updatedRemoteInfo . name ] =
553- await this . requestRemoteManifest ( parsedRemoteInfo ) ;
564+ await this . requestRemoteManifest ( parsedRemoteInfo , hostOptions ) ;
554565 fileLog (
555566 `end request manifest, this.updatedRemoteInfos[updatedRemoteInfo.name]: ${ JSON . stringify (
556567 this . updatedRemoteInfos [ updatedRemoteInfo . name ] ,
0 commit comments