@@ -110,7 +110,8 @@ DatabaseController.prototype.validateClassName = function(className) {
110
110
DatabaseController . prototype . loadSchema = function ( ) {
111
111
if ( ! this . schemaPromise ) {
112
112
this . schemaPromise = SchemaController . load ( this . adapter ) ;
113
- this . schemaPromise . then ( ( ) => delete this . schemaPromise ) ;
113
+ this . schemaPromise . then ( ( ) => delete this . schemaPromise ,
114
+ ( ) => delete this . schemaPromise ) ;
114
115
}
115
116
return this . schemaPromise ;
116
117
} ;
@@ -704,6 +705,7 @@ DatabaseController.prototype.find = function(className, query, {
704
705
let aclGroup = acl || [ ] ;
705
706
let op = typeof query . objectId == 'string' && Object . keys ( query ) . length === 1 ? 'get' : 'find' ;
706
707
let classExists = true ;
708
+ console . log ( 'will load schema' ) ;
707
709
return this . loadSchema ( )
708
710
. then ( schemaController => {
709
711
//Allow volatile classes if querying with Master (for _PushStatus)
@@ -717,6 +719,7 @@ DatabaseController.prototype.find = function(className, query, {
717
719
classExists = false ;
718
720
return { fields : { } } ;
719
721
}
722
+ console . log ( 'Cannot get one schema' ) ;
720
723
throw error ;
721
724
} )
722
725
. then ( schema => {
@@ -767,6 +770,7 @@ DatabaseController.prototype.find = function(className, query, {
767
770
if ( ! classExists ) {
768
771
return [ ] ;
769
772
} else {
773
+ console . log ( 'adapter find' ) ;
770
774
return this . adapter . find ( className , schema , query , { skip, limit, sort } )
771
775
. then ( objects => objects . map ( object => {
772
776
object = untransformObjectACL ( object ) ;
0 commit comments