Skip to content

Commit b041f89

Browse files
committed
Use subprocesses instead of a single process & up parallelism to three
1 parent aeb5dd0 commit b041f89

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/dump_restbase.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ function dumpWiki(options) {
3131

3232
return dumpPromise
3333
.then(function() {
34-
var dumpOptions = {
35-
dataBase: workDB,
36-
apiURL: 'http://' + domain + '/w/api.php',
37-
prefix: domain,
38-
ns: 0,
39-
host: 'http://rest.wikimedia.org',
40-
verbose: options.verbose
41-
};
42-
return makeDump(dumpOptions);
34+
var dumpOptions = [
35+
__dirname + '/../bin/dump_wiki',
36+
'--dataBase', workDB,
37+
'--apiURL', 'http://' + domain + '/w/api.php',
38+
'--prefix', domain,
39+
'--ns', '0',
40+
'--host', 'http://rest.wikimedia.org'
41+
];
42+
dumpOptions.push(options.verbose ? '--verbose' : '--no-verbose');
43+
return proc.execFileAsync('node', dumpOptions);
4344
})
4445
.then(function() {
4546
console.log('xz compressing');
@@ -69,7 +70,7 @@ function dumpAllWikis (options) {
6970
.catch(function(res) {
7071
console.log(domain, res);
7172
});
72-
}, { concurrency: 2 });
73+
}, { concurrency: 3 });
7374
})
7475
.then(function() {
7576
console.log('All dumps done.');

0 commit comments

Comments
 (0)