You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sebastian Bazley <se...@apache.org> on 2016/02/05 23:31:17 UTC

[whimsy.git] [1/1] Commit f3d3f35: More accurate comment

Commit f3d3f353521e0dbe6f20aaf9d21c68ec5574c7e3:
    More accurate comment
    Defensive programming - don't only look for 0


Branch: refs/heads/master
Author: Sebb <se...@apache.org>
Committer: Sebb <se...@apache.org>
Pusher: sebb <se...@apache.org>

------------------------------------------------------------
lib/whimsy/asf/ldap.rb                                       | ++ --
------------------------------------------------------------
4 changes: 2 additions, 2 deletions.
------------------------------------------------------------


diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index 3cd3f03..86fb29e 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -130,7 +130,7 @@ def self.search_one(base, filter, attrs=nil)
 
     Wunderbar.info "[#{target}] #{cmd}"
 
-    # retry once per host, with a minimum of two retries
+    # try once per host, with a minimum of two tries
     attempts_left = [ASF::LDAP.hosts.length, 2].min
     begin
       attempts_left -= 1
@@ -139,7 +139,7 @@ def self.search_one(base, filter, attrs=nil)
 
       result = @ldap.search2(base, ::LDAP::LDAP_SCOPE_ONELEVEL, filter, attrs)
     rescue Exception => re
-      if attempts_left == 0
+      if attempts_left <= 0
         Wunderbar.error "[#{target}] => #{re.inspect} for #{cmd}"
         raise
       else