Update mongodb to version 2.2.21 🚀 (#3368)

* chore(package): update mongodb to version 2.2.20

https://greenkeeper.io/

* Fix race when fetching schema frequently

* Bumps mongo to 2.2.21
This commit is contained in:
Greenkeeper
2017-01-16 22:26:14 +01:00
committed by Arthur Cinader
parent cb15c0b616
commit de4c1ee418
4 changed files with 22 additions and 8 deletions

View File

@@ -27,7 +27,7 @@
"lodash": "4.17.4", "lodash": "4.17.4",
"lru-cache": "4.0.2", "lru-cache": "4.0.2",
"mime": "1.3.4", "mime": "1.3.4",
"mongodb": "2.2.10", "mongodb": "2.2.21",
"multer": "1.2.1", "multer": "1.2.1",
"parse": "1.9.2", "parse": "1.9.2",
"parse-server-fs-adapter": "1.0.1", "parse-server-fs-adapter": "1.0.1",

View File

@@ -1631,8 +1631,9 @@ describe('Parse.Query testing', () => {
}); });
expect(total).toBe(0); expect(total).toBe(0);
done() done()
}, () => { }, (e) => {
fail('should not fail'); fail('should not fail');
fail(JSON.stringify(e));
done(); done();
}) })
}); });

View File

@@ -575,6 +575,9 @@ describe('Parse.Relation testing', () => {
expect(result.get('key').get('even')).toBe(false); expect(result.get('key').get('even')).toBe(false);
}); });
done(); done();
}, (e) => {
fail(JSON.stringify(e));
done();
}) })
}); });
@@ -613,6 +616,9 @@ describe('Parse.Relation testing', () => {
done(); done();
} }
})); }));
}, (e) => {
fail(JSON.stringify(e));
done();
}); });
}); });
@@ -653,6 +659,9 @@ describe('Parse.Relation testing', () => {
done(); done();
} }
})); }));
}, (e) => {
fail(JSON.stringify(e));
done();
}); });
}); });

View File

@@ -334,25 +334,29 @@ export default class SchemaController {
if (this.reloadDataPromise && !options.clearCache) { if (this.reloadDataPromise && !options.clearCache) {
return this.reloadDataPromise; return this.reloadDataPromise;
} }
this.data = {};
this.perms = {};
this.reloadDataPromise = promise.then(() => { this.reloadDataPromise = promise.then(() => {
return this.getAllClasses(options); return this.getAllClasses(options);
}) })
.then(allSchemas => { .then(allSchemas => {
const data = {};
const perms = {};
allSchemas.forEach(schema => { allSchemas.forEach(schema => {
this.data[schema.className] = injectDefaultSchema(schema).fields; data[schema.className] = injectDefaultSchema(schema).fields;
this.perms[schema.className] = schema.classLevelPermissions; perms[schema.className] = schema.classLevelPermissions;
}); });
// Inject the in-memory classes // Inject the in-memory classes
volatileClasses.forEach(className => { volatileClasses.forEach(className => {
const schema = injectDefaultSchema({ className }); const schema = injectDefaultSchema({ className });
this.data[className] = schema.fields; data[className] = schema.fields;
this.perms[className] = schema.classLevelPermissions; perms[className] = schema.classLevelPermissions;
}); });
this.data = data;
this.perms = perms;
delete this.reloadDataPromise; delete this.reloadDataPromise;
}, (err) => { }, (err) => {
this.data = {};
this.perms = {};
delete this.reloadDataPromise; delete this.reloadDataPromise;
throw err; throw err;
}); });