Skip to content

Commit de4c1ee

Browse files
greenkeeperio-botArthur Cinader
authored and
Arthur Cinader
committed
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
1 parent cb15c0b commit de4c1ee

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"lodash": "4.17.4",
2828
"lru-cache": "4.0.2",
2929
"mime": "1.3.4",
30-
"mongodb": "2.2.10",
30+
"mongodb": "2.2.21",
3131
"multer": "1.2.1",
3232
"parse": "1.9.2",
3333
"parse-server-fs-adapter": "1.0.1",

‎spec/ParseQuery.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1631,8 +1631,9 @@ describe('Parse.Query testing', () => {
16311631
});
16321632
expect(total).toBe(0);
16331633
done()
1634-
}, () => {
1634+
}, (e) => {
16351635
fail('should not fail');
1636+
fail(JSON.stringify(e));
16361637
done();
16371638
})
16381639
});

‎spec/ParseRelation.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,9 @@ describe('Parse.Relation testing', () => {
575575
expect(result.get('key').get('even')).toBe(false);
576576
});
577577
done();
578+
}, (e) => {
579+
fail(JSON.stringify(e));
580+
done();
578581
})
579582
});
580583

@@ -613,6 +616,9 @@ describe('Parse.Relation testing', () => {
613616
done();
614617
}
615618
}));
619+
}, (e) => {
620+
fail(JSON.stringify(e));
621+
done();
616622
});
617623
});
618624

@@ -653,6 +659,9 @@ describe('Parse.Relation testing', () => {
653659
done();
654660
}
655661
}));
662+
}, (e) => {
663+
fail(JSON.stringify(e));
664+
done();
656665
});
657666
});
658667

‎src/Controllers/SchemaController.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,25 +334,29 @@ export default class SchemaController {
334334
if (this.reloadDataPromise && !options.clearCache) {
335335
return this.reloadDataPromise;
336336
}
337-
this.data = {};
338-
this.perms = {};
339337
this.reloadDataPromise = promise.then(() => {
340338
return this.getAllClasses(options);
341339
})
342340
.then(allSchemas => {
341+
const data = {};
342+
const perms = {};
343343
allSchemas.forEach(schema => {
344-
this.data[schema.className] = injectDefaultSchema(schema).fields;
345-
this.perms[schema.className] = schema.classLevelPermissions;
344+
data[schema.className] = injectDefaultSchema(schema).fields;
345+
perms[schema.className] = schema.classLevelPermissions;
346346
});
347347

348348
// Inject the in-memory classes
349349
volatileClasses.forEach(className => {
350350
const schema = injectDefaultSchema({ className });
351-
this.data[className] = schema.fields;
352-
this.perms[className] = schema.classLevelPermissions;
351+
data[className] = schema.fields;
352+
perms[className] = schema.classLevelPermissions;
353353
});
354+
this.data = data;
355+
this.perms = perms;
354356
delete this.reloadDataPromise;
355357
}, (err) => {
358+
this.data = {};
359+
this.perms = {};
356360
delete this.reloadDataPromise;
357361
throw err;
358362
});

0 commit comments

Comments
 (0)