The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/settings/server/raw.js

21 lines
392 B

import { Settings } from '../../models/server/raw';
const cache = new Map();
export const setValue = (_id, value) => cache.set(_id, value);
const setFromDB = async (_id) => {
const value = await Settings.getValueById(_id);
setValue(_id, value);
return value;
};
export const getValue = async (_id) => {
if (!cache.has(_id)) {
return setFromDB(_id);
}
return cache.get(_id);
};