File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
native-federation-tests/src/lib
native-federation-typescript/src/lib Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @module-federation/native-federation-typescript ' : patch
3
+ ' @module-federation/native-federation-tests ' : patch
4
+ ---
5
+
6
+ download retrieves count per file
Original file line number Diff line number Diff line change @@ -27,11 +27,12 @@ const downloadErrorLogger =
27
27
} ;
28
28
29
29
export const downloadTypesArchive = ( hostOptions : Required < HostOptions > ) => {
30
- let retries = 0 ;
30
+ const retriesPerFile : Record < string , number > = { } ;
31
31
return async ( [ destinationFolder , fileToDownload ] : string [ ] ) => {
32
+ retriesPerFile [ fileToDownload ] = 0 ;
32
33
const destinationPath = join ( hostOptions . mocksFolder , destinationFolder ) ;
33
34
34
- while ( retries ++ < hostOptions . maxRetries ) {
35
+ while ( retriesPerFile [ fileToDownload ] ++ < hostOptions . maxRetries ) {
35
36
try {
36
37
const response = await axios
37
38
. get ( fileToDownload , { responseType : 'arraybuffer' } )
@@ -48,7 +49,7 @@ export const downloadTypesArchive = (hostOptions: Required<HostOptions>) => {
48
49
} `,
49
50
) ,
50
51
) ;
51
- if ( retries >= hostOptions . maxRetries ) {
52
+ if ( retriesPerFile [ fileToDownload ] >= hostOptions . maxRetries ) {
52
53
throw error ;
53
54
}
54
55
}
Original file line number Diff line number Diff line change @@ -37,11 +37,12 @@ const downloadErrorLogger =
37
37
} ;
38
38
39
39
export const downloadTypesArchive = ( hostOptions : Required < HostOptions > ) => {
40
- let retries = 0 ;
40
+ const retriesPerFile : Record < string , number > = { } ;
41
41
return async ( [ destinationFolder , fileToDownload ] : string [ ] ) => {
42
+ retriesPerFile [ fileToDownload ] = 0 ;
42
43
const destinationPath = join ( hostOptions . typesFolder , destinationFolder ) ;
43
44
44
- while ( retries ++ < hostOptions . maxRetries ) {
45
+ while ( retriesPerFile [ fileToDownload ] ++ < hostOptions . maxRetries ) {
45
46
try {
46
47
const response = await axios
47
48
. get ( fileToDownload , { responseType : 'arraybuffer' } )
@@ -58,7 +59,7 @@ export const downloadTypesArchive = (hostOptions: Required<HostOptions>) => {
58
59
} `,
59
60
) ,
60
61
) ;
61
- if ( retries >= hostOptions . maxRetries ) {
62
+ if ( retriesPerFile [ fileToDownload ] >= hostOptions . maxRetries ) {
62
63
throw error ;
63
64
}
64
65
}
You can’t perform that action at this time.
0 commit comments