Skip to content

Instantly share code, notes, and snippets.

@brenfrow
Created May 7, 2013 17:58
Show Gist options
  • Save brenfrow/5534696 to your computer and use it in GitHub Desktop.
Save brenfrow/5534696 to your computer and use it in GitHub Desktop.
campaigns = CampaignIDEnumerator.new(scheduler_queue: ShardCreation.daily_scheduler_queue)
campaigns.each do |campaign_id|
begin
campaign = Campaign.find(campaign_id)
snapshot = campaign.to_packrat_snapshot("mtoken")
date = Date.new(2013, 5, 4)
cycle_id = "index~83"
puts "cycle_id #{cycle_id}; date #{date}"
packrat_cycle = Packrat::CollectionCycle.new(cycle_id, date, Date.today)
Packrat.start_collection(snapshot, packrat_cycle, 'LSAPI')
rescue StandardError => e
puts " - #{campaign.id} errored: #{e.message}"
end
end and nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment