Skip to content

Commit

Permalink
Make sure to only have one cleanup interval
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 authored and rzr committed Jan 3, 2023
1 parent 2682d1f commit 3605054
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ class BluetoothHciSocketWrapped extends BluetoothHciSocket {
}

start(){
if (this._timer) {
clearInterval(this._timer);
}
// Every minute perform a cleanup of connecting devices
this._timer = setInterval(()=>{
this.cleanup();
Expand Down

0 comments on commit 3605054

Please sign in to comment.