From 8c655d55bf26621d3843fcb03c885399a9034732 Mon Sep 17 00:00:00 2001 From: Tarang Patel Date: Mon, 11 Nov 2013 23:19:32 +0200 Subject: [PATCH] Use cursor to iterate lists of users --- server/notifications.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/notifications.js b/server/notifications.js index b6acafe4d..a9b2e742b 100644 --- a/server/notifications.js +++ b/server/notifications.js @@ -53,11 +53,11 @@ Meteor.methods({ }, notifyUsers : function(notification, currentUser){ // send a notification to every user according to their notifications settings - _.each(Meteor.users.find().fetch(), function(user, index, list){ + Meteor.users.find().forEach(function(user) { if(user._id !== currentUser._id && getUserSetting('notifications.posts', false, user)){ // don't send users notifications for their own posts sendEmail(getEmail(user), notification.subject, notification.text, notification.html); } }); } -}); \ No newline at end of file +});