diff --git a/index.js b/index.js index 943c89a..e35f393 100644 --- a/index.js +++ b/index.js @@ -159,7 +159,8 @@ KinesisStream.prototype._putRecords = function(requestContent) { } }); } - + }) + .on('complete', function() { req.removeAllListeners(); req.response.httpResponse.stream.removeAllListeners(); req.httpRequest.stream.removeAllListeners(); @@ -251,7 +252,8 @@ KinesisStream.prototype._write = function (chunk, encoding, done) { err.records = [ _.omit(record, 'StreamName') ]; } done(err); - + }) + .on('complete', function() { req.removeAllListeners(); req.response.httpResponse.stream.removeAllListeners(); req.httpRequest.stream.removeAllListeners(); diff --git a/package.json b/package.json index 1791afe..7b1cb8a 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,15 @@ { "name": "aws-kinesis-writable", "description": "A bunyan stream for kinesis.", - "version": "1.4.7", + "version": "1.4.8", "author": "José F. Romaniello (http://joseoncode.com)", "repository": { "url": "git://github.com/auth0/kinesis-writable.git" }, "main": "index.js", "scripts": { - "test": "NODE_ENV=test istanbul cover _mocha -- -R spec --timeout 5000" + "test": "NODE_ENV=test mocha -R spec --timeout 5000", + "cover": "NODE_ENV=test istanbul cover _mocha -- -R spec --timeout 5000" }, "dependencies": { "aws-sdk": "~2.1.43",