mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 05:53:03 +00:00
16 lines
391 B
TypeScript
16 lines
391 B
TypeScript
let _fakeLRUcount = 0;
|
|
export const fakeDemoRedisCache = {
|
|
_cache: {},
|
|
get: (key) => {
|
|
const cache = fakeDemoRedisCache._cache[key];
|
|
_fakeLRUcount++;
|
|
if (_fakeLRUcount >= 10) {
|
|
fakeDemoRedisCache.clear();
|
|
_fakeLRUcount = 0;
|
|
}
|
|
return cache;
|
|
},
|
|
set: (key, data) => fakeDemoRedisCache._cache[key] = data,
|
|
clear: () => fakeDemoRedisCache._cache = {}
|
|
};
|