From ca62e5b43fa761e50e21eeab4ee997a22ec5ff47 Mon Sep 17 00:00:00 2001 From: joshua stein Date: Wed, 3 Jul 2013 22:11:12 -0500 Subject: [PATCH] try to fetch story cache twice if it fails the first time --- script/mail_new_activity | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/mail_new_activity b/script/mail_new_activity index 5d8a33f..803cfb9 100755 --- a/script/mail_new_activity +++ b/script/mail_new_activity @@ -50,6 +50,11 @@ last_story_id = (Keystore.value_for(LAST_STORY_KEY) || Story.last.id).to_i Story.where("id > ?", last_story_id).order(:id).each do |s| s.fetch_story_cache! + + if s.story_cache.blank? + s.fetch_story_cache! + end + s.save mailing_list_users.each do |u|