Rename vars

This commit is contained in:
Javier Goizueta 2019-11-20 12:57:18 +01:00
parent 0a7261e7a7
commit 1767384746

View File

@ -8,15 +8,15 @@ module.exports = class Throttler extends Transform {
this.pgstream = pgstream;
this.sampleLength = global.settings.copy_from_maximum_slow_input_speed_interval || 15;
this.minimunBytesPerSecondThreshold = global.settings.copy_from_minimum_input_speed || 0;
this.sampleSeconds = global.settings.copy_from_maximum_slow_input_speed_interval || 15;
this.minimunBytesPerSampleThreshold = global.settings.copy_from_minimum_input_speed || 0;
this.byteCount = 0;
this._interval = setInterval(this._updateMetrics.bind(this), this.sampleLength*1000);
this._interval = setInterval(this._updateMetrics.bind(this), this.sampleSeconds*1000);
}
_updateMetrics () {
if (this.byteCount < this.minimunBytesPerSecondThreshold) {
if (this.byteCount < this.minimunBytesPerSampleThreshold) {
clearInterval(this._interval);
this.pgstream.emit('error', new Error('Connection closed by server: input data too slow'));
}