From a31525c79f129bd35e0cfa04434eefa6dfcc33d9 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 24 Nov 2014 13:21:51 -0500 Subject: [PATCH] Skipping digest sending if no notifs and no new topics, #2455 --- src/user/digest.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/user/digest.js b/src/user/digest.js index 6c3adba7f7..a253ae62af 100644 --- a/src/user/digest.js +++ b/src/user/digest.js @@ -84,6 +84,11 @@ module.exports = (function(Digest) { notifications = notifications.filter(Boolean); + // If there are no notifications and no new topics, don't bother sending a digest + if (!notifications.length && !data.topics.topics.length) { + return next(); + } + for(var i=0; i