Skip to content

Instantly share code, notes, and snippets.

@floehopper
Created February 9, 2011 16:03
Show Gist options
  • Save floehopper/818705 to your computer and use it in GitHub Desktop.
Save floehopper/818705 to your computer and use it in GitHub Desktop.
We deleted these 90-day reminder SMSes from production
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]
@floehopper
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment