Stop recreating the dbus.systemBus on retries (old instances are not disposed correctly by underlying code)

This commit is contained in:
Victor Hagelbäck 2021-02-27 09:57:29 +01:00
parent 4d5a4ddbe3
commit 925ccba647
3 changed files with 39 additions and 13 deletions

View file

@ -56,7 +56,9 @@ class PlejdDeviceCommunication extends EventEmitter {
});
this.plejdBleHandler.on(PlejBLEHandler.EVENTS.reconnecting, () => {
logger.info('Bluetooth reconnecting...');
logger.verbose(`Stopping writeQueue loop until connection is established. Write queue length: ${this.writeQueue.length}`);
logger.verbose(
`Stopping writeQueue loop until connection is established. Write queue length: ${this.writeQueue.length}`,
);
this.bleConnected = false;
clearTimeout(this.writeQueueRef);
});