Created
November 24, 2009 21:17
-
-
Save jasonlyles/242226 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
def run_pulse_run | |
@id = params[:id] | |
@timeout = params[:timeout] | |
result = '' | |
#Adding a timeout on my end in hopes of keeping this page from crashing the mongrel | |
begin | |
status = Timeout::timeout(@timeout.to_i) do | |
#And adding a rescue for Mongrel timeouts, just to be safe | |
begin | |
result = PulseRunner.run_pulse_test(@id,@timeout) | |
rescue Mongrel::TimeoutError | |
puts "Mongrel::TimeoutError!!" | |
#Do nothing! The if block below will take care of it | |
end | |
end | |
rescue Timeout::Error => te | |
puts "Timeout:Error! (Not a mongrel timeout error)" | |
#Do nothing! The if block below will take care of it | |
end | |
if result != '' | |
@display = result | |
else | |
@display = "Unavailable" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment