Created
March 31, 2010 14:13
-
-
Save crohr/350359 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
until jobs.empty? do | |
job = jobs.shift | |
if job.reload['state'] == 'running' | |
begin | |
job.parent.deployments.submit({ | |
:nodes => job['assigned_nodes'], | |
:environment => 'lenny-x64-nfs_rc@granquet' | |
) | |
rescue Restfully::HTTP::ServerError => e | |
puts e.message | |
puts "Putting the job back on the queue to retry later" | |
jobs.push(job) | |
end | |
else | |
puts "Job not running. Putting back on the queue" | |
jobs.push(job) | |
sleep 2 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment