Improve wekan performance #837

This commit is contained in:
maulal 2017-02-18 02:18:39 +01:00 committed by Lauri Ojansivu
parent cd70076af2
commit cd6317cedb
4 changed files with 9 additions and 1 deletions

View file

@ -26,6 +26,9 @@ if (Meteor.isServer) {
function isAuthor(userId, doc, fieldNames = []) {
return userId === doc.userId && fieldNames.indexOf('userId') === -1;
}
Meteor.startup(() => {
UnsavedEditCollection._collection._ensureIndex({ userId: 1 });
});
UnsavedEditCollection.allow({
insert: isAuthor,
update: isAuthor,