summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/custodian-dequeue10
-rwxr-xr-xbin/custodian-enqueue16
-rwxr-xr-xbin/custodian-queue15
3 files changed, 35 insertions, 6 deletions
diff --git a/bin/custodian-dequeue b/bin/custodian-dequeue
index 2d907f4..e33e253 100755
--- a/bin/custodian-dequeue
+++ b/bin/custodian-dequeue
@@ -55,6 +55,7 @@ require 'getoptlong'
#
# Our code.
#
+require 'custodian/settings.rb'
require 'custodian/worker.rb'
@@ -65,11 +66,16 @@ require 'custodian/worker.rb'
#
if __FILE__ == $0 then
- $SERVER = "127.0.0.1:11300"
- $LOGFILE = "custodian-dequeue.log"
$help = false
$manual = false
+ #
+ # The beanstalkd server address, and logfile.
+ #
+ settings = Custodian::Settings.instance()
+ $SERVER = settings.queue_server
+ $LOGFILE = setttings.log_file
+
begin
opts = GetoptLong.new(
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
diff --git a/bin/custodian-enqueue b/bin/custodian-enqueue
index ad8796f..3a9ac7f 100755
--- a/bin/custodian-enqueue
+++ b/bin/custodian-enqueue
@@ -50,12 +50,17 @@
#
-# Modules we require
+# Standard modules
#
require 'beanstalk-client'
-require 'custodian/parser'
require 'getoptlong'
+#
+# Our code.
+#
+require 'custodian/parser'
+require 'custodian/settings'
+
#
@@ -65,7 +70,12 @@ if __FILE__ == $0 then
$help = false
$manual = false
- $SERVER = "127.0.0.1:11300"
+
+ #
+ # The beanstalkd server address.
+ #
+ settings = Custodian::Settings.instance()
+ $SERVER = settings.queue_server
begin
opts = GetoptLong.new(
diff --git a/bin/custodian-queue b/bin/custodian-queue
index e75b5cc..cb4c3ce 100755
--- a/bin/custodian-queue
+++ b/bin/custodian-queue
@@ -38,10 +38,18 @@
+#
+# Standard modules
+#
require 'beanstalk-client'
require 'getoptlong'
+#
+# Our code
+#
+require 'custodian/settings'
+
#
@@ -49,13 +57,18 @@ require 'getoptlong'
#
if __FILE__ == $0 then
- $SERVER = "127.0.0.1:11300"
$FLUSH = false
$STATS = false
$help = false
$manual = false
$MONITOR = false
+ #
+ # The beanstalkd server address.
+ #
+ settings = Custodian::Settings.instance()
+ $SERVER = settings.queue_server
+
begin
opts = GetoptLong.new(
[ "--flush", "-f", GetoptLong::NO_ARGUMENT ],