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 e7b8a5a82a
commit 042447d1a8
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);
});