Skip to content

Instantly share code, notes, and snippets.

@gertig
Created February 6, 2011 01:44
Show Gist options
  • Save gertig/813019 to your computer and use it in GitHub Desktop.
Save gertig/813019 to your computer and use it in GitHub Desktop.
Rails 3 demo of using HTTParty and Moment for delayed jobs
#lib/tasks/cron.rake
desc "This task is called by the Heroku cron add-on"
task :cron => :environment do
if Time.now.hour == 0 # run at midnight
Person.create_schedule
puts "Finished running my first CRON task"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment