summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-18 18:37:52 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-18 18:37:52 +0000
commit84341830fbec193df5cf1f728798a5e58feb7434 (patch)
treec2c077397a917963390db8629e04411e66e21d17 /lib
parent3fc0d46b4ac5c6f2dc69a61f1861c74d012571da (diff)
Added --fail flag.
Diffstat (limited to 'lib')
-rw-r--r--lib/custodian.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/custodian.rb b/lib/custodian.rb
index 6c0ec81..fec928b 100644
--- a/lib/custodian.rb
+++ b/lib/custodian.rb
@@ -104,6 +104,8 @@ class Custodian
#
def process_single_job
+ result = false
+
begin
job = @queue.reserve()
@@ -200,6 +202,7 @@ class Custodian
log_message( "Test succeeed - clearing alert" )
success = true
alert.clear()
+ result = true
end
count += 1
end
@@ -228,7 +231,20 @@ class Custodian
log_message( "Job ID : #{job.id} - Removed" )
job.delete if ( job )
end
+
+ return result
end
+
+
+ #
+ # Process jobs until we see a failure - stop then.
+ #
+ def process_until_fail
+ while( process_single_job() )
+ # nop
+ end
+ end
+
end