summaryrefslogtreecommitdiff
path: root/lib/custodian/worker.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-02-05 11:34:33 +0000
committerSteve Kemp <steve@steve.org.uk>2015-02-05 11:34:33 +0000
commit9c068c93ef36dcb8e1f2e8ea4f93a6752ac0db22 (patch)
tree6d0f26438fea38479941b2a8ea209a914ddcb772 /lib/custodian/worker.rb
parent12740c13dd36045ddbf86626e4b32455be2c5adf (diff)
More simplification - don't pass state around.
Rather than passing our settings-object around, as well as specific settings that are read from it, just pass the object. The worker can read the settings directly if/when it needs to.
Diffstat (limited to 'lib/custodian/worker.rb')
-rw-r--r--lib/custodian/worker.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/custodian/worker.rb b/lib/custodian/worker.rb
index adb3a65..78e7cf0 100644
--- a/lib/custodian/worker.rb
+++ b/lib/custodian/worker.rb
@@ -74,17 +74,18 @@ module Custodian
#
- # Constructor: Connect to the queue
+ # Constructor: Connect to the queue, and setup our settings.
#
- def initialize( server, alerter, logfile, settings )
+ def initialize( settings )
# Connect to the queue
- @queue = QueueType.create( settings.queue_type )
+ @queue = QueueType.create( settings.queue_type() )
# Get the alerter-type to instantiate
- @alerter = alerter
+ @alerter = settings.alerter
# Instantiate the logger.
+ logfile = settings.log_file
@logger = Logger.new( logfile, "daily" )
# Save the settings