Rename vars
This commit is contained in:
parent
0a7261e7a7
commit
1767384746
@ -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'));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user