Skip to content

Commit

Permalink
fix: branch merge issue. Fix Prio queue timer
Browse files Browse the repository at this point in the history
  • Loading branch information
ztalbot2000 committed May 4, 2021
1 parent 3ceca21 commit 146a558
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Cmd4PriorityPollingQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let trueTypeOf = require( "./utils/trueTypeOf" );

let HIGH_PRIORITY_SET = 0;
let HIGH_PRIORITY_GET = 1;
let LOW_PRIORITY_GET = 1;
let LOW_PRIORITY_GET = 2;

class Cmd4PriorityPollingQueue
{
Expand Down Expand Up @@ -255,7 +255,11 @@ class Cmd4PriorityPollingQueue
entry.accessory.log.info( `Poll failed: ${ error } for queue: ${ this.queueName }` );
}

// For the next one
self.inProgressGets --;

// This will restart the polling timer if not anything else
setTimeout( ( ) => { self.processQueue( HIGH_PRIORITY_GET ); }, 0);
}, pollingID );
}

Expand Down Expand Up @@ -391,6 +395,7 @@ class Cmd4PriorityPollingQueue
this.pollingTimer = setTimeout( ( ) =>
{
this.log.debug( `Polling Timer Firing` );
this.pollingTimer = null;
this.processQueue( LOW_PRIORITY_GET );

}, this.currentIntervalBeingUsed );
Expand Down

0 comments on commit 146a558

Please sign in to comment.