Skip to content

Instantly share code, notes, and snippets.

@werkshy
Created March 7, 2014 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save werkshy/9420418 to your computer and use it in GitHub Desktop.
Save werkshy/9420418 to your computer and use it in GitHub Desktop.
# Start the autoscaler engine loop in a begin/rescue block
def start_autoscaler
@stopped = false
@heroku_manager = nil
while true do
begin
if @stopped
break
end
self.run_loop
sleep @interval
rescue SystemExit, Interrupt # purposeful quit, ctrl-c, kill signal etc
raise
rescue Exception => e # any other error
ErrorHandler.report(e)
sleep @interval
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment