wait 2 minutes before mailing out new comments to allow edits

This commit is contained in:
joshua stein 2013-08-23 21:53:48 -05:00
parent 6b17bbd9a5
commit fce8c73fda

View file

@ -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