@@ -9,10 +9,6 @@ import { RoutineNode } from '../explorer/models/routineNode';
9
9
import { config } from '../extension' ;
10
10
import Bottleneck from 'bottleneck' ;
11
11
12
- const limiter = new Bottleneck ( {
13
- maxConcurrent : 1
14
- } ) ;
15
-
16
12
const filesFilter = ( file : any ) => {
17
13
if ( file . cat === 'CSP' || file . name . startsWith ( '%' ) || file . name . startsWith ( 'INFORMATION.' ) ) {
18
14
return false ;
@@ -107,14 +103,24 @@ export async function exportList(files: string[]): Promise<any> {
107
103
if ( ! files || ! files . length ) {
108
104
vscode . window . showWarningMessage ( 'Nothing to export' ) ;
109
105
}
110
- const { atelier, folder } = config ( ) . get ( 'export' ) ;
106
+ const { atelier, folder, maxConcurrentConnections } = config ( ) . get ( 'export' ) ;
111
107
112
- const results = [ ] ;
113
- for ( let i = 0 ; i < files . length ; i ++ ) {
114
- const result = await limiter . schedule ( ( ) => exportFile ( files [ i ] , getFileName ( folder , files [ i ] , atelier ) ) ) ;
115
- results . push ( result ) ;
108
+ if ( maxConcurrentConnections > 0 ) {
109
+ const limiter = new Bottleneck ( {
110
+ maxConcurrent : maxConcurrentConnections
111
+ } ) ;
112
+ const results = [ ] ;
113
+ for ( let i = 0 ; i < files . length ; i ++ ) {
114
+ const result = await limiter . schedule ( ( ) => exportFile ( files [ i ] , getFileName ( folder , files [ i ] , atelier ) ) ) ;
115
+ results . push ( result ) ;
116
+ }
117
+ return results ;
116
118
}
117
- return results ;
119
+ return Promise . all (
120
+ files . map ( file => {
121
+ exportFile ( file , getFileName ( folder , file , atelier ) ) ;
122
+ } )
123
+ ) ;
118
124
}
119
125
120
126
export async function exportAll ( ) : Promise < any > {
0 commit comments