lamassu-server/lib/middlewares/settingsCache.js
Cesar 85235eaa13 Feat: refactor routes.js express entrypoint config
Feat: express config script refactor

Feat: add state and settingsCache files
2021-03-19 14:04:31 +00:00

19 lines
No EOL
444 B
JavaScript

const state = require('./state')
const getTimestamp = () => state.settingsCache.timestamp
const getCache = () => state.settingsCache.cache
const setTimestamp = (newTimestamp) => state.settingsCache.timestamp = newTimestamp
const setCache = (newCache) => state.settingsCache.cache = newCache
const clearCache = () => state.settingsCache.cache = null
module.exports = {
getTimestamp,
getCache,
setTimestamp,
setCache,
clearCache
}