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 = () => {
clearTimeout(this.timerBatch);
delete this.timerBatch;
const msg = this.name + "-" + '[' + this.batch.join(',') + ']';
this.batch = [];
if (this.messageCallback)
this.messageCallback(msg);
if (this.batch.length) {
const msg = this.name + "-" + '[' + this.batch.join(',') + ']';
this.batch = [];
if (this.messageCallback)
this.messageCallback(msg);
}
};
_message = (message) => {