Skip to content
Browse files

Gah, I'm dumb and didn't read how Heroku crons work

  • Loading branch information...
1 parent 6747f02 commit e223bd666978fcb38ebfc14182f7ecad8caee5a8 @kneath committed May 4, 2009
Showing with 15 additions and 7 deletions.
  1. +15 −0 Rakefile
  2. +0 −7 lib/tasks/cron.rake
View
15 Rakefile
@@ -26,4 +26,19 @@ namespace :app do
task :update_milestones => :setup do
Burndown::Milestone.sync_with_lighthouse
end
+end
+
+task :environment do
+ require "lib/burndown"
+ Burndown.new(File.dirname(__FILE__) + "/config/config.yml")
+end
+
+task :cron => :environment do
+ if Time.now.hour == 23
+ puts "Updating milestones..."
+ Burndown::Milestone.sync_with_lighthouse
+ puts "done."
+ else
+ puts "Not executing for another #{23 - Time.now.hour} hours"
+ end
end
View
7 lib/tasks/cron.rake
@@ -1,7 +0,0 @@
-task :cron => :environment do
- if Time.now.hour == 23
- puts "Updating milestones..."
- Burndown::Milestone.sync_with_lighthouse
- puts "done."
- end
-end

0 comments on commit e223bd6

Please sign in to comment.
Something went wrong with that request. Please try again.