Built basic blog backend.
This commit is contained in:
6
private/cache/CacheStore.js
vendored
6
private/cache/CacheStore.js
vendored
@ -54,13 +54,17 @@ class CacheStore {
|
||||
this.store.del(keys);
|
||||
}
|
||||
|
||||
flush() {
|
||||
this.store.flushAll();
|
||||
}
|
||||
|
||||
//Database related stores
|
||||
async getFromDatabase(key, query, params, method) {
|
||||
if(typeof params === typeof undefined) params = {};
|
||||
if(typeof method === typeof undefined) method = "any";
|
||||
|
||||
return await this.get(key, async () => {
|
||||
return await this.database[method](query, params);
|
||||
return await this.getDatabase()[method](query, params);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user