summaryrefslogtreecommitdiffstats
path: root/models/unsavedEdits.js
diff options
context:
space:
mode:
authormaulal <maulal@none.fr>2017-02-18 02:18:39 +0100
committerLauri Ojansivu <x@xet7.org>2017-02-22 17:05:30 +0200
commitcd6317cedbd9815284d4e533f00fbc75c8e06afc (patch)
treefc42b8c26097a8688d5430b79d84c739ffb48387 /models/unsavedEdits.js
parentcd70076af2b0d34c2fb4a0ef52c02c8f9da28a69 (diff)
downloadwekan-cd6317cedbd9815284d4e533f00fbc75c8e06afc.tar.gz
wekan-cd6317cedbd9815284d4e533f00fbc75c8e06afc.tar.bz2
wekan-cd6317cedbd9815284d4e533f00fbc75c8e06afc.zip
Improve wekan performance #837
Diffstat (limited to 'models/unsavedEdits.js')
-rw-r--r--models/unsavedEdits.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/unsavedEdits.js b/models/unsavedEdits.js
index 25952fb5..d4f3616a 100644
--- a/models/unsavedEdits.js
+++ b/models/unsavedEdits.js
@@ -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,