@@ -186,6 +186,10 @@ class ParseServer {
186
186
const emailControllerAdapter = loadAdapter ( emailAdapter ) ;
187
187
const cacheControllerAdapter = loadAdapter ( cacheAdapter , InMemoryCacheAdapter , { appId : appId } ) ;
188
188
189
+ const createSchemaCache = function ( ) {
190
+ let adapter = loadAdapter ( cacheAdapter , InMemoryCacheAdapter , { appId : appId , ttl : schemaCacheTTL } ) ;
191
+ return new SchemaCache ( adapter , schemaCacheTTL ) ;
192
+ }
189
193
// We pass the options and the base class for the adatper,
190
194
// Note that passing an instance would work too
191
195
const filesController = new FilesController ( filesControllerAdapter , appId ) ;
@@ -194,7 +198,7 @@ class ParseServer {
194
198
const userController = new UserController ( emailControllerAdapter , appId , { verifyUserEmails } ) ;
195
199
const liveQueryController = new LiveQueryController ( liveQuery ) ;
196
200
const cacheController = new CacheController ( cacheControllerAdapter , appId ) ;
197
- const databaseController = new DatabaseController ( databaseAdapter , new SchemaCache ( schemaCacheTTL ) ) ;
201
+ const databaseController = new DatabaseController ( databaseAdapter , createSchemaCache ( ) ) ;
198
202
const hooksController = new HooksController ( appId , databaseController , webhookKey ) ;
199
203
200
204
// TODO: create indexes on first creation of a _User object. Otherwise it's impossible to
@@ -246,7 +250,8 @@ class ParseServer {
246
250
expireInactiveSessions : expireInactiveSessions ,
247
251
revokeSessionOnPasswordReset,
248
252
databaseController,
249
- schemaCacheTTL
253
+ schemaCacheTTL,
254
+ createSchemaCache
250
255
} ) ;
251
256
252
257
// To maintain compatibility. TODO: Remove in some version that breaks backwards compatability
0 commit comments