Chore: make populateSettings middleware use node-cache

This commit is contained in:
csrapr 2021-05-07 17:23:47 +01:00 committed by Josh Harvey
parent fb4267b0d5
commit 7657da5e16
5 changed files with 29 additions and 45 deletions

View file

@ -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: {},