@segment/analytics.js-integration-segmentio
Advanced tools
Comparing version 3.5.3 to 3.5.4
3.5.4 / 2017-08-24 | ||
================== | ||
* cap retryQueue to 100 items, tune backoff strategy | ||
3.5.3 / 2017-08-02 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -35,2 +35,19 @@ 'use strict'; | ||
/** | ||
* Queue options | ||
* | ||
* for first hour, attempt with backoff | ||
* Sum[k^2, {k, 0, 21}] = 3311000 (55min) | ||
* for remaining 23 hours, attempt 1/hr (linear) | ||
* total = 45 attempts | ||
*/ | ||
var queueOptions = { | ||
maxRetryDelay: 360000, // max interval of 1hr | ||
minRetryDelay: 1000, // first attempt (1s) | ||
backoffFactor: 2, | ||
maxAttempts: 45, | ||
maxItems: 100 | ||
}; | ||
/** | ||
* Expose `Segment` integration. | ||
@@ -75,5 +92,5 @@ */ | ||
if (this.options.retryQueue) { | ||
this._lsqueue = new Queue('segmentio', function(item, done) { | ||
this._lsqueue = new Queue('segmentio', queueOptions, function(item, done) { | ||
// apply sentAt at flush time and reset on each retry | ||
// so the tracking-api doesn't interperet a time skew | ||
// so the tracking-api doesn't interpret a time skew | ||
item.msg.sentAt = new Date(); | ||
@@ -80,0 +97,0 @@ // send |
{ | ||
"name": "@segment/analytics.js-integration-segmentio", | ||
"description": "The Segmentio analytics.js integration.", | ||
"version": "3.5.3", | ||
"version": "3.5.4", | ||
"keywords": [ | ||
@@ -30,3 +30,3 @@ "analytics.js", | ||
"@segment/analytics.js-integration": "^2.1.0", | ||
"@segment/localstorage-retry": "^1.1.0", | ||
"@segment/localstorage-retry": "^1.2.0", | ||
"@segment/protocol": "^1.0.0", | ||
@@ -33,0 +33,0 @@ "@segment/send-json": "^3.0.0", |
60331
1405