gd-sprest 9.8.1 → 9.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/rest.js CHANGED
@@ -6,7 +6,7 @@ import { GraphTypes, SPTypes } from "./sptypes";
6
6
  * SharePoint REST Library
7
7
  */
8
8
  export const $REST = {
9
- __ver: 9.81,
9
+ __ver: 9.82,
10
10
  AppContext: (siteUrl) => { return Lib.Site.getAppContext(siteUrl); },
11
11
  Apps: Lib.Apps,
12
12
  ContextInfo: Lib.ContextInfo,
@@ -712,9 +712,9 @@ export const Request = {
712
712
  targetInfo.url = data["@odata.nextLink"] || data.d.__next;
713
713
  // Set the sleep value to prevent throttling
714
714
  let sleepInMS = 0;
715
- if (xhr.rateLimit && xhr.rateLimit.remaining < 50) {
716
- // Set the rate
717
- sleepInMS = xhr.rateLimit.reset * 1000;
715
+ if (xhr.rateLimit) {
716
+ // Set the sleep time to be twice the amount of suggested
717
+ sleepInMS = xhr.rateLimit.reset * 2000;
718
718
  // Log
719
719
  console.info("[gd-sprest] Throttle approaching... Waiting " + sleepInMS + "ms before sending the next request.", xhr.rateLimit);
720
720
  }