From cf350013807bf347af29f17a4c87861c194e3e10 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Thu, 5 Feb 2015 11:34:33 +0000 Subject: 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. --- lib/custodian/worker.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/custodian') 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 -- cgit v1.2.1