Skip to content

Commit bf41abe

Browse files
author
Cookiezaurs
committed
fixes
1 parent a412bf2 commit bf41abe

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

bin/scripts/expire-data/countly_multi_app_expireData.js

+2-24
Original file line numberDiff line numberDiff line change
@@ -27,33 +27,11 @@ Promise.all([plugins.dbConnection("countly"), plugins.dbConnection("countly_dril
2727
var dropIndex = false;
2828
for (var i = 0; i < indexes.length; i++) {
2929
if (indexes[i].name == INDEX_NAME) {
30-
if (!indexes[i].expireAfterSeconds || indexes[i].expireAfterSeconds <= EXPIRE_AFTER) {
31-
//print("skipping", c)
32-
hasIndex = true;
33-
}
34-
//has index but incorrect expire time, need to be reindexed
35-
else {
36-
dropIndex = true;
37-
}
30+
hasIndex=true;
3831
break;
3932
}
4033
}
41-
if (dropIndex) {
42-
console.log("modifying index", collection);
43-
db_drill.command({
44-
"collMod": collection,
45-
"index": {
46-
"keyPattern": {"cd": 1},
47-
}
48-
}, function(err) {
49-
if (err) {
50-
console.log(err);
51-
}
52-
done();
53-
});
54-
55-
}
56-
else if (!hasIndex) {
34+
if (!hasIndex) {
5735
console.log("creating index", collection);
5836
db_drill.collection(collection).createIndex({"cd": 1}, function() {
5937
done(true);

0 commit comments

Comments
 (0)