Browse files

build every day, reboot on failure

  • Loading branch information...
1 parent dd5c31d commit 9d99775fef546aa449519980ff9797a30a9d5cb3 pivotal committed Jan 10, 2011
Showing with 4 additions and 1 deletion.
  1. +2 −1 app/models/build.rb
  2. +2 −0 script/builder
View
3 app/models/build.rb
@@ -12,7 +12,8 @@ def latest_hashes
end
def should_run?
- runs.find_by_git_hash(latest_hashes) == nil
+ run = runs.find_by_git_hash(latest_hashes)
+ run == nil || run.updated_at < Time.now - 60*60*24
end
def building?
View
2 script/builder
@@ -3,6 +3,8 @@ require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
TIME_BETWEEN_CHECKS = 30
+at_exit { system("sudo reboot") }
+
loop do
build = Build.next_to_run
if build

0 comments on commit 9d99775

Please sign in to comment.