summaryrefslogtreecommitdiff
path: root/bin/custodian-enqueue
diff options
context:
space:
mode:
Diffstat (limited to 'bin/custodian-enqueue')
-rwxr-xr-xbin/custodian-enqueue11
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/custodian-enqueue b/bin/custodian-enqueue
index 41378e6..e2e4420 100755
--- a/bin/custodian-enqueue
+++ b/bin/custodian-enqueue
@@ -6,6 +6,7 @@
# SYNOPSIS
# custodian-enqueue [ -h | --help ]
# [ -m | --manual]
+# [ -q | --queue NAME]
# [ -f | --file FILE]
# [ -d | --dump ]
# [ | --test ]
@@ -18,6 +19,8 @@
#
# -d, --dump Dump the parsed tests to the console; don't insert in the queue.
#
+# -q, --queue Use the named beanstalkd tube.
+#
# --test Test the parsing of the given file, alert on errors.
#
# -f, --file FILE Parse the given configuration file.
@@ -74,6 +77,7 @@ if __FILE__ == $0 then
#
settings = Custodian::Settings.instance()
$SERVER = settings.queue_server
+ $QUEUE = settings.queue_name
begin
opts = GetoptLong.new(
@@ -82,6 +86,7 @@ if __FILE__ == $0 then
[ "--server", GetoptLong::REQUIRED_ARGUMENT ],
[ "--file", "-f", GetoptLong::REQUIRED_ARGUMENT ],
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
+ [ "--queue", "-q", GetoptLong::REQUIRED_ARGUMENT ],
[ "--manual","-m", GetoptLong::NO_ARGUMENT ]
)
opts.each do |opt, arg|
@@ -92,7 +97,9 @@ if __FILE__ == $0 then
ENV["TEST"] = "1"
when "--server" then
$SERVER = arg
- when "--file" then
+ when "--queue" then
+ $QUEUE= arg
+ when "--file" then
ENV["FILE"] = arg
when "--help" then
$help = true
@@ -139,7 +146,7 @@ if __FILE__ == $0 then
#
# Connected to the server
#
- queue = Beanstalk::Pool.new([$SERVER], "Custodian")
+ queue = Beanstalk::Pool.new([$SERVER], $QUEUE )
if ( ! queue )
puts "Failed to connect to beanstalk server: #{$SERVER}"
exit 1