summaryrefslogtreecommitdiff
path: root/bin/custodian-enqueue
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-01-21 16:49:43 +0000
committerSteve Kemp <steve@steve.org.uk>2015-01-21 16:49:43 +0000
commitf1a6eb09eba8e946e530745cbd19f5f754f505ff (patch)
tree82cff89e1ae010675a790ebc1996993c56956188 /bin/custodian-enqueue
parent959cac12f785e00e79934a2cff945e8302db26b1 (diff)
Don't hard-wire redis as the queue-type.
Read it from the configuration-file and don't expose the server flag which is now bogus.
Diffstat (limited to 'bin/custodian-enqueue')
-rwxr-xr-xbin/custodian-enqueue16
1 files changed, 4 insertions, 12 deletions
diff --git a/bin/custodian-enqueue b/bin/custodian-enqueue
index 20654c1..672ace9 100755
--- a/bin/custodian-enqueue
+++ b/bin/custodian-enqueue
@@ -68,17 +68,10 @@ if __FILE__ == $0 then
$help = false
$manual = false
- #
- # The beanstalkd server address.
- #
- settings = Custodian::Settings.instance()
- $SERVER = settings.queue_server
-
begin
opts = GetoptLong.new(
[ "--dump", "-d", GetoptLong::NO_ARGUMENT ],
[ "--test", GetoptLong::NO_ARGUMENT ],
- [ "--server", GetoptLong::REQUIRED_ARGUMENT ],
[ "--file", "-f", GetoptLong::REQUIRED_ARGUMENT ],
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
[ "--manual","-m", GetoptLong::NO_ARGUMENT ]
@@ -89,8 +82,6 @@ if __FILE__ == $0 then
ENV["DUMP"] = "1"
when "--test" then
ENV["TEST"] = "1"
- when "--server" then
- $SERVER = arg
when "--file" then
ENV["FILE"] = arg
when "--help" then
@@ -136,11 +127,12 @@ if __FILE__ == $0 then
#
- # Connected to the server
+ # Connected to the queue - be it redis or beanstalkd
#
- queue = Custodian::QueueType.create( "redis" )
+ settings = Custodian::Settings.instance()
+ queue = Custodian::QueueType.create( settings.queue_type() )
if ( ! queue )
- puts "Failed to connect to beanstalk server: #{$SERVER}"
+ puts "Failed to connect to the #{settings.queue_type()} queue"
exit 1
end