mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: licenses administration basic authentication.
feat: accounts slug. feat: duplicate accounts_balance table and merge balance with accounts table. feat: refactoring customers and vendors. feat: system user soft deleting. feat: preventing build tenant database without any subscription. feat: remove 'password' property from 'req.user' object. feat: refactoring JournalPoster class. feat: delete duplicated directories and files.
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
import NodeCache from 'node-cache';
|
||||
|
||||
class Cache {
|
||||
export default class Cache {
|
||||
cache: NodeCache;
|
||||
|
||||
constructor() {
|
||||
constructor(config?: object) {
|
||||
this.cache = new NodeCache({
|
||||
// stdTTL: 9999999,
|
||||
// checkperiod: 9999999 * 0.2,
|
||||
useClones: false,
|
||||
...config,
|
||||
});
|
||||
}
|
||||
|
||||
get(key, storeFunction) {
|
||||
get(key: string, storeFunction: () => Promise<any>) {
|
||||
const value = this.cache.get(key);
|
||||
|
||||
|
||||
if (value) {
|
||||
return Promise.resolve(value);
|
||||
}
|
||||
@@ -22,11 +22,11 @@ class Cache {
|
||||
});
|
||||
}
|
||||
|
||||
set(key, results) {
|
||||
set(key: string, results: any) {
|
||||
this.cache.set(key, results);
|
||||
}
|
||||
|
||||
del(keys) {
|
||||
del(keys: string) {
|
||||
this.cache.del(keys);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,4 @@ class Cache {
|
||||
flush() {
|
||||
this.cache.flushAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default new Cache();
|
||||
}
|
||||
Reference in New Issue
Block a user