Skip to content

Commit 49639b3

Browse files
committed
checked expiration
1 parent 1d598a6 commit 49639b3

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

dist/breinify-api.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15729,14 +15729,15 @@ dependencyScope.jQuery = $;;
1572915729
return this.splitTestData;
1573015730
}
1573115731

15732-
// clean-up old split-test information
15732+
// clean-up old split-test information (older than 7 days)
15733+
var testExpiration = new Date().getTime() - (7 * 24 * 60 * 1000);
1573315734
for (var key in this.splitTestData) {
1573415735
if (!this.splitTestData.hasOwnProperty(key)) {
1573515736
continue;
1573615737
}
1573715738

1573815739
var lastUpdated = this.splitTestData[key].lastUpdated;
15739-
if (typeof lastUpdated !== number || lastUpdated < -1) {
15740+
if (typeof lastUpdated !== number || lastUpdated < testExpiration) {
1574015741
delete this.splitTestData[key];
1574115742
}
1574215743
}

dist/breinify-api.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Breinify.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,15 @@
137137
return this.splitTestData;
138138
}
139139

140-
// clean-up old split-test information
140+
// clean-up old split-test information (older than 7 days)
141+
var testExpiration = new Date().getTime() - (7 * 24 * 60 * 1000);
141142
for (var key in this.splitTestData) {
142143
if (!this.splitTestData.hasOwnProperty(key)) {
143144
continue;
144145
}
145146

146147
var lastUpdated = this.splitTestData[key].lastUpdated;
147-
if (typeof lastUpdated !== number || lastUpdated < -1) {
148+
if (typeof lastUpdated !== number || lastUpdated < testExpiration) {
148149
delete this.splitTestData[key];
149150
}
150151
}

0 commit comments

Comments
 (0)