Skip to content

Commit

Permalink
[IMPROVE] Do not emit settings if there are no changes (#12904)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored and sampaiodiego committed Dec 11, 2018
1 parent 54adba1 commit 69ea9ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/rocketchat-lib/server/publications/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ Meteor.methods({
},
});

RocketChat.models.Settings.on('change', ({ clientAction, id, data }) => {
RocketChat.models.Settings.on('change', ({ clientAction, id, data, diff }) => {
if (diff && Object.keys(diff).length === 1 && diff._updatedAt) { // avoid useless changes
return;
}
switch (clientAction) {
case 'updated':
case 'inserted':
Expand Down

0 comments on commit 69ea9ec

Please sign in to comment.