fluent-logger
Advanced tools
Comparing version 2.6.0 to 2.6.1
@@ -403,3 +403,3 @@ 'use strict'; | ||
FluentSender.prototype._setupErrorHandler = function _setupErrorHandler() { | ||
FluentSender.prototype._setupErrorHandler = function _setupErrorHandler(callback) { | ||
if (!this.reconnectInterval) { | ||
@@ -413,3 +413,3 @@ return; | ||
this.internalLogger.info('Fluentd will reconnect after ' + this.reconnectInterval / 1000 + ' seconds'); | ||
setTimeout(() => { | ||
let timeoutId = setTimeout(() => { | ||
this.internalLogger.info('Fluentd is reconnecting...'); | ||
@@ -420,2 +420,3 @@ this._connect(() => { | ||
}, this.reconnectInterval); | ||
callback && callback(timeoutId); | ||
}); | ||
@@ -422,0 +423,0 @@ }; |
@@ -26,3 +26,3 @@ 'use strict'; | ||
Transport.call(this); | ||
Transport.call(this, options); | ||
} | ||
@@ -29,0 +29,0 @@ |
{ | ||
"name": "fluent-logger", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"main": "./lib/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -95,4 +95,3 @@ 'use strict'; | ||
}); | ||
s._setupErrorHandler(); | ||
s.on('error', function(err) { | ||
s._setupErrorHandler((timeoutId) => { | ||
expect(logger.buffer.info).to.have.lengthOf(1); | ||
@@ -102,2 +101,3 @@ expect(logger.buffer.info[0]).to.be.equal('Fluentd will reconnect after 600 seconds'); | ||
expect(logger.buffer.error[0]).to.be.equal('Fluentd error'); | ||
clearTimeout(timeoutId); | ||
done(); | ||
@@ -104,0 +104,0 @@ }); |
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
118523
16
1682