Allow setting the label cache size
This commit is contained in:
@@ -267,6 +267,16 @@ LRUCache.prototype.set = function(key, value) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Set a maximum number of entries for the cache.
|
||||
* @param {number} size Cache size.
|
||||
* @api
|
||||
*/
|
||||
LRUCache.prototype.setSize = function(size) {
|
||||
this.highWaterMark = size;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Prune the cache.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user