Upon boot, hydra workers will now require hydra_worker_init.rb in the current working directory if it is present.

This commit is contained in:
Luke Melia 2010-06-09 09:16:17 -04:00 committed by Luke Melia
parent 585c40ad01
commit a131de53f1
1 changed files with 10 additions and 1 deletions

View File

@ -20,6 +20,7 @@ module Hydra #:nodoc:
@runners = []
@listeners = []
load_worker_initializer
boot_runners(opts.fetch(:runners) { 1 })
@io.write(Hydra::Messages::Worker::WorkerBegin.new)
@ -28,7 +29,15 @@ module Hydra #:nodoc:
@runners.each{|r| Process.wait r[:pid] }
end
def load_worker_initializer
if File.exist?('./hydra_worker_init.rb')
trace('Requiring hydra_worker_init.rb')
require 'hydra_worker_init'
else
trace('hydra_worker_init.rb not present')
end
end
# message handling methods
# When a runner wants a file, it hits this method with a message.