1
0
Fork 0

restrict cap constraint for _statistics

This commit is contained in:
Jan Steemann 2014-05-14 21:33:35 +02:00
parent a69d93b7c9
commit 2adeda7da3
1 changed files with 25 additions and 0 deletions

View File

@ -666,6 +666,31 @@
return result;
});
////////////////////////////////////////////////////////////////////////////////
/// @brief createStatisticsCap
////////////////////////////////////////////////////////////////////////////////
// create the _statistics collection
addTask("createStatisticsCap", "restrict _statistics collection", function () {
var collection = getCollection("_statistics");
if (! collection) {
return false;
}
// find existing cap constraint and drop it
collection.getIndexes().forEach(function (idx) {
if (idx.type === "cap") {
collection.dropIndex(idx.id);
}
});
// re-create proper cap constraint
collection.ensureCapConstraint(6 * 60 * 12); // 1/2 day (every 10 secs);
return true;
});
////////////////////////////////////////////////////////////////////////////////
/// @brief createConfiguration