elasticsearch-bulk-index-stream
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -5,2 +5,7 @@ # Change Log | ||
## [0.1.2] - 2015-11-16 | ||
### Fixed | ||
- Log right amount of records. The records count that was logged was | ||
doubled in previous release. | ||
## [0.1.1] - 2015-11-16 | ||
@@ -7,0 +12,0 @@ ### Fixed |
16
index.js
@@ -70,6 +70,2 @@ 'use strict'; | ||
ElasticsearchBulkIndexWritable.prototype.bulkWrite = function bulkWrite(records, callback) { | ||
if (this.logger) { | ||
this.logger.debug('Writing %d records to Elasticsearch', records.length); | ||
} | ||
this.client.bulk({ body: records }, function bulkCallback(err, data) { | ||
@@ -99,6 +95,2 @@ if (err) { | ||
if (this.logger) { | ||
this.logger.info('Wrote %d records to Elasticsearch', records.length); | ||
} | ||
callback(); | ||
@@ -126,2 +118,6 @@ }.bind(this)); | ||
if (this.logger) { | ||
this.logger.debug('Writing %d records to Elasticsearch', this.queue.length); | ||
} | ||
this.bulkWrite(records, function(err) { | ||
@@ -132,2 +128,6 @@ if (err) { | ||
if (this.logger) { | ||
this.logger.info('Wrote %d records to Elasticsearch', this.queue.length); | ||
} | ||
this.writtenRecords += this.queue.length; | ||
@@ -134,0 +134,0 @@ this.queue = []; |
{ | ||
"name": "elasticsearch-bulk-index-stream", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A writable stream for bulk indexing records in Elasticsearch", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
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
16472