Add maxAge param to lru-cache to be able to refresh entries when staled
This commit is contained in:
parent
64b4efef17
commit
9d6726227a
@ -8,6 +8,8 @@ var queue = require('queue-async');
|
|||||||
|
|
||||||
var LruCache = require("lru-cache");
|
var LruCache = require("lru-cache");
|
||||||
|
|
||||||
|
const TEN_MINUTES_IN_MILLISECONDS = 1000 * 60 * 10;
|
||||||
|
|
||||||
function NamedMapProviderCache(
|
function NamedMapProviderCache(
|
||||||
templateMaps,
|
templateMaps,
|
||||||
pgConnection,
|
pgConnection,
|
||||||
@ -23,7 +25,7 @@ function NamedMapProviderCache(
|
|||||||
this.mapConfigAdapter = mapConfigAdapter;
|
this.mapConfigAdapter = mapConfigAdapter;
|
||||||
this.affectedTablesCache = affectedTablesCache;
|
this.affectedTablesCache = affectedTablesCache;
|
||||||
|
|
||||||
this.providerCache = new LruCache({ max: 2000 });
|
this.providerCache = new LruCache({ max: 2000, maxAge: TEN_MINUTES_IN_MILLISECONDS });
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = NamedMapProviderCache;
|
module.exports = NamedMapProviderCache;
|
||||||
|
Loading…
Reference in New Issue
Block a user