comprodls-sdk 2.79.0 → 2.81.0

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.
@@ -6856,7 +6856,12 @@ function deleteAssignedPath(options) {
6856
6856
  item_type: 'string', //mandatory, ['dls-internal','external']
6857
6857
  dls_product_code: 'string' //mandatory only if item_type is 'dls-internal'
6858
6858
  }
6859
- ]
6859
+ ],
6860
+ "rules": {}, // Optional
6861
+ "context": { // Optional (Needed for system event only)
6862
+ "bundle-code": "string",
6863
+ "space_key": "string"
6864
+ }
6860
6865
  }
6861
6866
  }
6862
6867
  */
@@ -12863,8 +12868,8 @@ function _connect(pubnubCW, options) {
12863
12868
  },
12864
12869
  'pollingEndpoint': options.pollingEndpoint,
12865
12870
  'pollingIterations': options.pollingIterations || 10, // Default polling iterations is 10
12866
- 'pollingInterval': options.pollingInterval || 1, // Default polling interval is 1 minute
12867
- });
12871
+ 'pollingInterval': options.pollingInterval, // Default polling interval is exponential backoff
12872
+ });
12868
12873
  }
12869
12874
 
12870
12875
  function _cleanup(pubnubCW) { pubnubCW.cleanup(); }
@@ -13373,8 +13378,18 @@ module.exports = function () {
13373
13378
  error = new PUSHXError(helpers.errors.ERROR_CATEGORY.PUSHX, error);
13374
13379
  _eventEmitter.emit('pushx_status', error);
13375
13380
  } else {
13381
+ var timeoutDelay;
13382
+
13383
+ // If the polling interval is provided, use that
13384
+ if (_userOptions.pollingInterval) {
13385
+ timeoutDelay = _userOptions.pollingInterval * 60 * 1000;
13386
+ } else {
13387
+ // Else, use exponential backoff
13388
+ timeoutDelay = parseInt(Math.pow(1.3, _pollingCounter) * 10 * 1000, 10);
13389
+ }
13390
+
13376
13391
  // Set timeout for next poll
13377
- _setTimeoutIDForPolling = setTimeout(_pollForEvents, _userOptions.pollingInterval * 60 * 1000);
13392
+ _setTimeoutIDForPolling = setTimeout(_pollForEvents, timeoutDelay);
13378
13393
  }
13379
13394
  });
13380
13395
  };