Changed Rule.resetCounter to delete all keys, allowing for garbage collection

This commit is contained in:
Anubhav Jain
2015-06-29 14:10:34 -07:00
parent ac1e0355c5
commit 38fe0d41e4

View File

@@ -170,9 +170,9 @@ _.extend(Rule.prototype, {
// has exceeded the intervalTime.
resetCounter: function () {
var self = this;
_.each(self.counters, function (value, key) {
self.counters[key] = 0;
});
// Delete the old counters dictionary to allow for garbage collection
self.counters = {};
self._lastResetTime = new Date().getTime();
}
});