Adds schema caching capabilities (5s by default) (#2286)

* Adds schema caching capabilities (off by default)

* Use InMemoryCacheAdapter

* Uses proper adapter to generate a cache

* Fix bugs when running disabled cache

* nits

* nits

* Use options object instead of boolean

* Imrpove concurrency of loadSchema

* Adds testing with SCHEMA_CACHE_ON

* Use CacheController instead of generator

- Makes caching SchemaCache use a generated prefix
- Makes clearing the SchemaCache clear only the cached schema keys
- Enable cache by default (ttl 5s)
This commit is contained in:
Florent Vilmart
2016-07-23 06:23:59 +02:00
committed by Drew
parent 66c4b98b55
commit 09bd9e3b2c
14 changed files with 205 additions and 47 deletions

View File

@@ -9,13 +9,19 @@ let Parse = require('parse/node').Parse;
let rest = require('../src/rest');
let request = require("request");
let config = new Config('test');
let database = config.database;
let config;
let database;
let defaultColumns = require('../src/Controllers/SchemaController').defaultColumns;
const installationSchema = { fields: Object.assign({}, defaultColumns._Default, defaultColumns._Installation) };
describe('Installations', () => {
beforeEach(() => {
config = new Config('test');
database = config.database;
});
it_exclude_dbs(['postgres'])('creates an android installation with ids', (done) => {
var installId = '12345678-abcd-abcd-abcd-123456789abc';
var device = 'android';