From 521970d92aa9341de76eff1086bca1bea0675665 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Tue, 23 Apr 2013 10:11:47 +0100 Subject: Allow --queue to specify the beanstalkd tube. --- bin/custodian-queue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bin/custodian-queue') diff --git a/bin/custodian-queue b/bin/custodian-queue index f50a9bd..3e20410 100755 --- a/bin/custodian-queue +++ b/bin/custodian-queue @@ -69,6 +69,7 @@ if __FILE__ == $0 then # settings = Custodian::Settings.instance() $SERVER = settings.queue_server + $QUEUE = settings.queue_name begin opts = GetoptLong.new( @@ -77,6 +78,7 @@ if __FILE__ == $0 then [ "--manual", "-m", GetoptLong::NO_ARGUMENT ], [ "--monitor", "-M", GetoptLong::OPTIONAL_ARGUMENT ], [ "--server", "-S", GetoptLong::REQUIRED_ARGUMENT ], + [ "--queue", "-q", GetoptLong::REQUIRED_ARGUMENT ], [ "--stats", "-s", GetoptLong::NO_ARGUMENT ] ) opts.each do |opt, arg| @@ -93,6 +95,8 @@ if __FILE__ == $0 then $FLUSH = true when "--server" then $SERVER = arg + when "--queue" then + $QUEUE = arg when "--help" then $help = true when "--manual" then @@ -136,7 +140,7 @@ if __FILE__ == $0 then # # Create the queue object. # - queue = Beanstalk::Pool.new([$SERVER], "Custodian" ) + queue = Beanstalk::Pool.new([$SERVER], $QUEUE ) # # Alerting on a queue that is too-full? -- cgit v1.2.1