diff options
| author | Steve Kemp <steve@steve.org.uk> | 2012-11-13 09:04:01 +0000 | 
|---|---|---|
| committer | Steve Kemp <steve@steve.org.uk> | 2012-11-13 09:04:01 +0000 | 
| commit | e49b27e28164e311e5224e2a3d1a837b1a9c215b (patch) | |
| tree | b0baeecf7ad8c9fb4c3dd928bddcb65f32cf9fc8 | |
| parent | bd9fbb0ee556ff56211c0df944f7e478fb89cc14 (diff) | |
  Allow the beanstalkd to be specified.
| -rwxr-xr-x | worker/worker | 13 | 
1 files changed, 8 insertions, 5 deletions
diff --git a/worker/worker b/worker/worker index 33f6122..5fcd312 100755 --- a/worker/worker +++ b/worker/worker @@ -43,8 +43,7 @@ require 'tests/ssh'  # -#  This class encapsulates the raising and clearing of alerts -# via Mauve. +#  This class encapsulates the raising and clearing of alerts via Mauve.  #  class Alert @@ -81,8 +80,8 @@ class Custodian    #    # Constructor: Connect to the queue    # -  def initialize -    @queue = Beanstalk::Pool.new(['localhost:11300']) +  def initialize( server ) +    @queue = Beanstalk::Pool.new([server])    end @@ -198,11 +197,13 @@ end  #  if __FILE__ == $0 then +  $SERVER = "localhost:11300";    begin      opts = GetoptLong.new(                            [ "--verbose", "-v", GetoptLong::NO_ARGUMENT ],                            [ "--flush",   "-f", GetoptLong::NO_ARGUMENT ], +                          [ "--server",  "-S", GetoptLong::REQUIRED_ARGUMENT ],                            [ "--single",  "-s", GetoptLong::NO_ARGUMENT ]                            )      opts.each do |opt, arg| @@ -211,6 +212,8 @@ if __FILE__ == $0 then            ENV["VERBOSE"] = "1"        when "--flush":            ENV["FLUSH"] = "1" +      when "--server": +          ENV["SERVER"] = arg        when "--single":            ENV["SINGLE"] = "1"        end @@ -223,7 +226,7 @@ if __FILE__ == $0 then    #    #  Create the object    # -  worker = Custodian.new() +  worker = Custodian.new( $SERVER )    #    #  Are we flushing the queue?  | 
