@cloudant/couchbackup
Advanced tools
Comparing version 2.0.1-SNAPSHOT.96 to 2.0.1-SNAPSHOT.97
# Unreleased | ||
- [NEW] Changed to use nodejs-cloudant for database requests. | ||
- [IMPROVED] Added compression to restore process requests. | ||
- [FIXED] An unhandled `readstream.destroy is not a function` error when trying | ||
@@ -5,0 +6,0 @@ to terminate a restore process that encountered an error. |
@@ -18,2 +18,3 @@ // Copyright © 2017 IBM Corp. All rights reserved. | ||
const stream = require('stream'); | ||
const zlib = require('zlib'); | ||
const error = require('./error.js'); | ||
@@ -38,3 +39,13 @@ const debug = require('debug')('couchbackup:writer'); | ||
db.bulk(payload, function(err) { | ||
// Stream the payload through a zip stream to the server | ||
var payloadStream = new stream.PassThrough(); | ||
payloadStream.end(Buffer.from(JSON.stringify(payload), 'utf8')); | ||
var zipstream = zlib.createGzip(); | ||
var req = db.server.request({ | ||
db: db.config.db, | ||
path: '_bulk_docs', | ||
method: 'POST', | ||
headers: {'content-encoding': 'gzip'} | ||
}, function(err) { | ||
err = error.convertResponseError(err); | ||
@@ -50,2 +61,3 @@ if (err) { | ||
}); | ||
payloadStream.pipe(zipstream).pipe(req); | ||
}, parallelism); | ||
@@ -52,0 +64,0 @@ |
{ | ||
"name": "@cloudant/couchbackup", | ||
"version": "2.0.1-SNAPSHOT.96", | ||
"version": "2.0.1-SNAPSHOT.97", | ||
"description": "CouchBackup - command-line backup utility for Cloudant/CouchDB", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/cloudant/couchbackup", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88842
1613