Adding Caching Adapter, allows caching of _Role and _User queries (fixes #168) (#1664)

* Adding Caching Adapter, allows caching of _Role and _User queries.
This commit is contained in:
Blayne Chard
2016-05-18 12:12:30 +12:00
parent 5d887e18f0
commit 8c09c3dae1
18 changed files with 526 additions and 134 deletions

View File

@@ -2,7 +2,7 @@
// configured.
// mount is the URL for the root of the API; includes http, domain, etc.
import cache from './cache';
import AppCache from './cache';
function removeTrailingSlash(str) {
if (!str) {
@@ -17,7 +17,7 @@ function removeTrailingSlash(str) {
export class Config {
constructor(applicationId: string, mount: string) {
let DatabaseAdapter = require('./DatabaseAdapter');
let cacheInfo = cache.apps.get(applicationId);
let cacheInfo = AppCache.get(applicationId);
if (!cacheInfo) {
return;
}
@@ -38,6 +38,7 @@ export class Config {
this.verifyUserEmails = cacheInfo.verifyUserEmails;
this.appName = cacheInfo.appName;
this.cacheController = cacheInfo.cacheController;
this.hooksController = cacheInfo.hooksController;
this.filesController = cacheInfo.filesController;
this.pushController = cacheInfo.pushController;