message: Try to reduce the frequency of retries if DIM Sync is down
diff: @@ -133,11 +133,11 @@ function loadGlobalSettings(): ThunkResult {
  /**
  * Wait, with exponential backoff - we'll try infinitely otherwise, in a tight loop!
  - * Double the wait time, starting with 30 seconds, until we reach 5 minutes.
  + * Double the wait time, starting with 60 seconds, until we reach 10 minutes.
  */
  function getBackoffWaitTime(backoff: number) {
  // Don't wait less than 10 seconds or more than 10 minutes
  - return Math.max(10_000, Math.min(10 * 60 * 1000, Math.random() * Math.pow(2, backoff) * 15_000));
  + return Math.max(10_000, Math.min(10 * 60 * 1000, Math.random() * Math.pow(2, backoff) * 30_000));
  }
  // Backoff multiplier
  @@ -287,7 +287,11 @@ function flushUpdates(): ThunkResult {
  return;
  }
  - if (dimApiState.updateInProgressWatermark === 0 && dimApiState.updateQueue.length > 0) {
  + // Skip if there's already an update going on, or the queue is empty
  + if (dimApiState.updateInProgressWatermark !== 0 || dimApiState.updateQueue.length === 0) {
  + return;
  + }
  +
  // Prepare the queue
  dispatch(prepareToFlushUpdates());
  dimApiState = getState().dimApi;
  @@ -296,12 +300,7 @@ function flushUpdates(): ThunkResult {
  return;
  }
  - infoLog(
  - 'flushUpdates',
  - 'Flushing queue of',
  - dimApiState.updateInProgressWatermark,
  - 'updates'
  - );
  + infoLog('flushUpdates', 'Flushing queue of', dimApiState.updateInProgressWatermark, 'updates');
  // Only select the items that were frozen for update. They're guaranteed
  // to not change while we're updating and they'll be for a single profile.
  @@ -322,6 +321,7 @@ function flushUpdates(): ThunkResult {
  dispatch(finishedUpdates(results));
  + dimApiState = getState().dimApi;
  if (dimApiState.updateQueue.length > 0) {
  // Flush more updates!
  dispatch(flushUpdates());
  @@ -354,7 +354,6 @@ function flushUpdates(): ThunkResult {
  throw e;
  }
  - }
  };
  }
  