@@ -186,6 +186,10 @@ class ParseServer {
186186 const emailControllerAdapter = loadAdapter ( emailAdapter ) ;
187187 const cacheControllerAdapter = loadAdapter ( cacheAdapter , InMemoryCacheAdapter , { appId : appId } ) ;
188188
189+ const createSchemaCache = function ( ) {
190+ let adapter = loadAdapter ( cacheAdapter , InMemoryCacheAdapter , { appId : appId , ttl : schemaCacheTTL } ) ;
191+ return new SchemaCache ( adapter , schemaCacheTTL ) ;
192+ }
189193 // We pass the options and the base class for the adatper,
190194 // Note that passing an instance would work too
191195 const filesController = new FilesController ( filesControllerAdapter , appId ) ;
@@ -194,7 +198,7 @@ class ParseServer {
194198 const userController = new UserController ( emailControllerAdapter , appId , { verifyUserEmails } ) ;
195199 const liveQueryController = new LiveQueryController ( liveQuery ) ;
196200 const cacheController = new CacheController ( cacheControllerAdapter , appId ) ;
197- const databaseController = new DatabaseController ( databaseAdapter , new SchemaCache ( schemaCacheTTL ) ) ;
201+ const databaseController = new DatabaseController ( databaseAdapter , createSchemaCache ( ) ) ;
198202 const hooksController = new HooksController ( appId , databaseController , webhookKey ) ;
199203
200204 // TODO: create indexes on first creation of a _User object. Otherwise it's impossible to
@@ -246,7 +250,8 @@ class ParseServer {
246250 expireInactiveSessions : expireInactiveSessions ,
247251 revokeSessionOnPasswordReset,
248252 databaseController,
249- schemaCacheTTL
253+ schemaCacheTTL,
254+ createSchemaCache
250255 } ) ;
251256
252257 // To maintain compatibility. TODO: Remove in some version that breaks backwards compatability
0 commit comments