From a33d4c285812691045ad9307a44b9a00e009b2d3 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Thu, 1 Aug 2013 14:21:55 +0100 Subject: Updated the cool-off period to work after every failed test, bar the last one. --- debian/changelog | 7 +++++++ lib/custodian/worker.rb | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c49fa0d..e84a721 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +custodian (0.10-5) stable; urgency=low + + * Updated cool-off period to occur after all but the last test, if the test + fails. + + -- Patrick J Cherry Thu, 01 Aug 2013 14:21:03 +0100 + custodian (0.10-4) stable; urgency=low * Correctly specify the Bytemark IPv6 ranges. diff --git a/lib/custodian/worker.rb b/lib/custodian/worker.rb index b502e1b..b9c9995 100644 --- a/lib/custodian/worker.rb +++ b/lib/custodian/worker.rb @@ -195,12 +195,12 @@ module Custodian # Some of our routers don't like being hammered. # # We delay before re-testing, but we only do this if - # we're not on the first count. + # we're not on the last count. # # The intention here is that if the test passes then there will # be no delay. If the test fails then we'll sleep. # - if ( ( @retry_delay > 0 ) && ( count != 1 ) ) + if ( ( result == false ) && ( @retry_delay > 0 ) && ( count < @retry_count ) ) log_message( "Sleeping for #{@retry_delay} seconds to allow cool-down" ) sleep( @retry_delay ) end -- cgit v1.2.1