Created
February 9, 2011 16:03
-
-
Save floehopper/818705 to your computer and use it in GitHub Desktop.
We deleted these 90-day reminder SMSes from production
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def Resque.next_delayed_timestamp | |
timestamp = redis.zrangebyscore(:delayed_queue_schedule, '-inf', 100.days.from_now.to_i, 'limit', 0, 1).first | |
timestamp.to_i unless timestamp.nil? | |
end | |
jobs = (0..99).map do |index| | |
timestamp = Resque.next_delayed_timestamp | |
if timestamp | |
Resque.next_item_for_timestamp(timestamp) | |
end | |
end.compact | |
jobs = [{"args"=>[597], "class"=>"Jobs::NinetyDayReminderSMS", "queue"=>"ninety_day_reminder_sms"}, {"args"=>[598], "class"=>"Jobs::NinetyDayReminderSMS", "queue"=>"ninety_day_reminder_sms"}, {"args"=>[599], "class"=>"Jobs::NinetyDayReminderSMS", "queue"=>"ninety_day_reminder_sms"}, {"args"=>[601], "class"=>"Jobs::NinetyDayReminderSMS", "queue"=>"ninety_day_reminder_sms"}, {"args"=>[600], "class"=>"Jobs::NinetyDayReminderSMS", "queue"=>"ninety_day_reminder_sms"}, {"args"=>[602], "class"=>"Jobs::NinetyDayReminderSMS", "queue"=>"ninety_day_reminder_sms"}, {"args"=>[603], "class"=>"Jobs::NinetyDayReminderSMS", "queue"=>"ninety_day_reminder_sms"}, {"args"=>[604], "class"=>"Jobs::NinetyDayReminderSMS", "queue"=>"ninety_day_reminder_sms"}, {"args"=>[605], "class"=>"Jobs::NinetyDayReminderSMS", "queue"=>"ninety_day_reminder_sms"}, {"args"=>[606], "class"=>"Jobs::NinetyDayReminderSMS", "queue"=>"ninety_day_reminder_sms"}, {"args"=>[607], "class"=>"Jobs::NinetyDayReminderSMS", "queue"=>"ninety_day_reminder_sms"}, {"args"=>[608], "class"=>"Jobs::NinetyDayReminderSMS", "queue"=>"ninety_day_reminder_sms"}] | |
account_ids = jobs.map { |j| j["args"][0] } # => [597, 598, 599, 601, 600, 602, 603, 604, 605, 606, 607, 608] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We didn't want to send these, because of the lack of messages over the last couple of months, but we thought it worth recording the account ids in case we want to send them one in the future.