* Adding Caching Adapter, allows caching of _Role and _User queries.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import cache from './cache';
|
||||
import log from './logger';
|
||||
import AppCache from './cache';
|
||||
import log from './logger';
|
||||
|
||||
var Parse = require('parse/node').Parse;
|
||||
|
||||
@@ -36,7 +36,7 @@ function handleParseHeaders(req, res, next) {
|
||||
|
||||
var fileViaJSON = false;
|
||||
|
||||
if (!info.appId || !cache.apps.get(info.appId)) {
|
||||
if (!info.appId || !AppCache.get(info.appId)) {
|
||||
// See if we can find the app id on the body.
|
||||
if (req.body instanceof Buffer) {
|
||||
// The only chance to find the app id is if this is a file
|
||||
@@ -51,8 +51,8 @@ function handleParseHeaders(req, res, next) {
|
||||
|
||||
if (req.body &&
|
||||
req.body._ApplicationId &&
|
||||
cache.apps.get(req.body._ApplicationId) &&
|
||||
(!info.masterKey || cache.apps.get(req.body._ApplicationId).masterKey === info.masterKey)
|
||||
AppCache.get(req.body._ApplicationId) &&
|
||||
(!info.masterKey || AppCache.get(req.body._ApplicationId).masterKey === info.masterKey)
|
||||
) {
|
||||
info.appId = req.body._ApplicationId;
|
||||
info.javascriptKey = req.body._JavaScriptKey || '';
|
||||
@@ -87,7 +87,7 @@ function handleParseHeaders(req, res, next) {
|
||||
req.body = new Buffer(base64, 'base64');
|
||||
}
|
||||
|
||||
info.app = cache.apps.get(info.appId);
|
||||
info.app = AppCache.get(info.appId);
|
||||
req.config = new Config(info.appId, mount);
|
||||
req.info = info;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user