Skip to content

Commit 464bb36

Browse files
committed
Allow the user to specify the article fetch concurrency
1 parent 9f7e857 commit 464bb36

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

bin/dump_wiki

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ var argParser = require('yargs')
3232
.options('verbose', {
3333
default : true
3434
})
35+
.options('c', {
36+
alias: 'concurrency',
37+
default: 50
38+
})
3539
//.default('apiURL', 'http://en.wikipedia.org/w/api.php')
3640
//.default('prefix', 'en.wikipedia.org')
3741
//.default('ns', '0')

lib/htmldump.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ process.on('SIGUSR2', function() {
2121
var preq = require('preq');
2222
var PromiseStream = require('./PromiseStream');
2323

24-
// Article dump parallelism
25-
var maxConcurrency = 50;
26-
2724
function getArticles (options, res) {
2825
if (!res || res.next === 'finished') {
2926
// nothing more to do.
@@ -185,7 +182,7 @@ function dumpLoop (options) {
185182
{next: ''}, 6);
186183
var dumper = new Dumper(articleChunkStream, options);
187184
var dumpStream = new PromiseStream(dumper.next.bind(dumper),
188-
undefined, 1, maxConcurrency);
185+
undefined, 1, options.concurrency);
189186

190187
var i = 0;
191188
return new P(function(resolve, reject) {

0 commit comments

Comments
 (0)