From fce8c73fda9947e044c1d563ee9340fe07322cee Mon Sep 17 00:00:00 2001 From: joshua stein Date: Fri, 23 Aug 2013 21:53:48 -0500 Subject: [PATCH] wait 2 minutes before mailing out new comments to allow edits --- script/mail_new_activity | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/mail_new_activity b/script/mail_new_activity index c4de746..7c75d28 100755 --- a/script/mail_new_activity +++ b/script/mail_new_activity @@ -120,6 +120,11 @@ last_comment_id = (Keystore.value_for(LAST_COMMENT_KEY) || Comment.where("id > ? AND (is_deleted = ? AND is_moderated = ?)", last_comment_id, false, false).order(:id).each do |c| + # allow some time for newer comments to be edited before sending them out + if (Time.now - c.created_at) < 2.minutes + break + end + mailing_list_users.each do |u| if (c.story.tags.map{|t| t.id } & u.tag_filters.map{|t| t.tag_id }).any? next