summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-02-18 08:33:35 +0000
committerSteve Kemp <steve@steve.org.uk>2015-02-18 08:33:35 +0000
commit017830edfabf028d60143b52f80971ceaaa41c1f (patch)
treeb8692b33274b9429ee42a6cb602c247a4e67ce02
parent323b48523820b23c4d09f2cefc66309ce64d6aea (diff)
Updated comments for better accuracy.
-rw-r--r--lib/custodian/worker.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/custodian/worker.rb b/lib/custodian/worker.rb
index 52d00e1..e036168 100644
--- a/lib/custodian/worker.rb
+++ b/lib/custodian/worker.rb
@@ -53,6 +53,7 @@ module Custodian
#
attr_reader :retry_count
+
#
# Should we sleep between repeated tests?
#
@@ -74,14 +75,16 @@ module Custodian
#
- # Constructor: Connect to the queue, and setup our settings.
+ # Constructor.
+ #
+ # Connect to the queue, and record interesting settings away.
#
def initialize( settings )
# Connect to the queue
@queue = QueueType.create( settings.queue_type() )
- # Get the alerter-type to instantiate
+ # Get the alerter-type(s) to instantiate
@alerter = settings.alerter
# Instantiate the logger.
@@ -103,8 +106,7 @@ module Custodian
#
- # Write the given message to our logfile - and show it to the console
- # if we're running with '--verbose' in play
+ # Write the given message to our logfile - and show it to the console too.
#
def log_message( msg )
@logger.info( msg )
@@ -145,9 +147,8 @@ module Custodian
raise ArgumentError, "Job was empty" if (job.nil?)
raise ArgumentError, "Job was not a string" unless job.kind_of?(String)
-
#
- # Create the test-object from our class-factory
+ # Create test-objects from our class-factory, and process them.
#
Custodian::TestFactory.create( job ).each do |test|
process_single_test( test )
@@ -156,7 +157,11 @@ module Custodian
#
- # Fetch a single job from the queue, and process it.
+ # Process a single test.
+ #
+ # A test which succeeds will clear any outstanding alert.
+ #
+ # Any test which fails for N-times in a row will raise an alert.
#
def process_single_test( test )