From 49ef9b1e49a0f2b53a97afbacb0bed0f20b1fab1 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Sun, 18 Nov 2012 18:37:52 +0000 Subject: Added --fail flag. --- lib/custodian.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib') 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 -- cgit v1.2.1