1
0
mirror of https://github.com/nttgin/BGPalerter.git synced 2024-05-19 06:50:08 +00:00

fix issue with empty batches in connector

This commit is contained in:
Massimo Candela
2020-01-14 02:51:12 +01:00
parent f5871a7ccf
commit a7bcd12bc3

View File

@@ -71,10 +71,12 @@ export default class Connector {
_sendBatch = () => { _sendBatch = () => {
clearTimeout(this.timerBatch); clearTimeout(this.timerBatch);
delete this.timerBatch; delete this.timerBatch;
const msg = this.name + "-" + '[' + this.batch.join(',') + ']'; if (this.batch.length) {
this.batch = []; const msg = this.name + "-" + '[' + this.batch.join(',') + ']';
if (this.messageCallback) this.batch = [];
this.messageCallback(msg); if (this.messageCallback)
this.messageCallback(msg);
}
}; };
_message = (message) => { _message = (message) => {