[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Debian JP master SVN www commits (rev.1140)



=======================================================
Repository: /org/svn.debian.or.jp/repos
  Revision: 1140
  Commiter: yasu
      Date: 2011-03-20 17:47:33 +0900 (日, 20  3月 2011)
=======================================================
Log:

fix 10000 problem...


=======================================================
Changed:

U   cdn/trunk/DNS-Balance/dns_balance.rb

Modified: cdn/trunk/DNS-Balance/dns_balance.rb
===================================================================
--- cdn/trunk/DNS-Balance/dns_balance.rb	2011-03-08 16:03:55 UTC (rev 1139)
+++ cdn/trunk/DNS-Balance/dns_balance.rb	2011-03-20 08:47:33 UTC (rev 1140)
@@ -184,8 +184,12 @@
 
   $addr_db[namespace][name].each {
     |i|
-    rnd_max = rand(rnd_max).to_i + (10000 - min(10000, i[1])) # badness の最大値は 10000
-    rnd_slesh.push(rnd_max)
+	 if i[1] >= 10000
+         	next
+         else
+    		rnd_max = rand(rnd_max).to_i + (10000 - min(10000, i[1])) # badness の最大値は 10000
+    		rnd_slesh.push(rnd_max)
+	end
   }
   return [rnd_max, rnd_slesh]
 end