couchdb-bulk2
Advanced tools
Comparing version 2.0.2 to 2.0.3
15
cli.js
@@ -41,3 +41,3 @@ #!/usr/bin/env node | ||
const batch = [] | ||
let batch = [] | ||
@@ -53,6 +53,11 @@ inStream | ||
if (batch.length >= docsPerBulk) { | ||
this.pause() | ||
await bulkPost(batch) | ||
batch = [] | ||
this.resume() | ||
try { | ||
this.pause() | ||
await bulkPost(batch) | ||
batch = [] | ||
this.resume() | ||
} catch (err) { | ||
console.error('bulk error', err) | ||
process.exit(1) | ||
} | ||
} | ||
@@ -59,0 +64,0 @@ }) |
{ | ||
"name": "couchdb-bulk2", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Pipe line-seperated JSON into CouchDB", | ||
@@ -5,0 +5,0 @@ "main": "cli.js", |
6063
76