Permalink
Browse files

Merge branch 'worker-safe-shutdown' into dev

  • Loading branch information...
2 parents f5aa307 + 84d9734 commit 653c1b1bef951382578046d449ff0c9da95ee8cc @dekellum committed Dec 4, 2012
Showing with 9 additions and 1 deletion.
  1. +8 −1 iudex-worker/lib/iudex-worker/agent.rb
  2. +1 −0 iudex-worker/test/test_agent.rb
@@ -33,9 +33,12 @@ class Agent
include Iudex::Worker
include Gravitext::HTMap
+ attr_accessor :raise_on_run
+
def initialize
@log = RJack::SLF4J[ self.class ]
@http_manager = nil
+ @raise_on_run = false
Hooker.apply( [ :iudex, :worker ], self )
end
@@ -121,7 +124,11 @@ def run_safe
end # fcf closes
rescue => e
- @log.error( "On run: ", e )
+ if @raise_on_run
+ raise e
+ else
+ @log.error( "On run: ", e )
+ end
ensure
hclient.close if hclient && hclient.respond_to?( :close )
@http_manager.shutdown if @http_manager
@@ -92,6 +92,7 @@ def vm.start
end
agent = Agent.new
+ agent.raise_on_run = true
agent.run
pass

0 comments on commit 653c1b1

Please sign in to comment.