Chore: make populateSettings middleware use node-cache
This commit is contained in:
parent
fb4267b0d5
commit
7657da5e16
5 changed files with 29 additions and 45 deletions
|
|
@ -1,7 +1,13 @@
|
|||
const NodeCache = require('node-cache')
|
||||
const SETTINGS_CACHE_REFRESH = 3600
|
||||
|
||||
module.exports = (function () {
|
||||
return {
|
||||
oldVersionId: 'unset',
|
||||
settingsCache: {},
|
||||
settingsCache: new NodeCache({
|
||||
stdTTL: SETTINGS_CACHE_REFRESH,
|
||||
checkperiod: SETTINGS_CACHE_REFRESH // Clear cache every hour
|
||||
}),
|
||||
canLogClockSkewMap: {},
|
||||
canGetLastSeenMap: {},
|
||||
pids: {},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue