Page 1 of 1

# 90415-0925 - Fixed rare division by zero bug - questions

PostPosted: Mon Jun 10, 2013 7:59 pm
by bobbymc
in AST_VDadapt.pl can you point out where int he code this fix was made please?

Re: # 90415-0925 - Fixed rare division by zero bug - questio

PostPosted: Wed Jun 12, 2013 5:20 am
by DomeDan
It was easy to find using git and tig
Code: Select all
diff --git a/bin/AST_VDadapt.pl b/bin/AST_VDadapt.pl
index 7bae877..58fd250 100644
--- a/bin/AST_VDadapt.pl
+++ b/bin/AST_VDadapt.pl
@@ -27,6 +27,7 @@
 # 81021-2201 - Deactivated queue_log QUEUESTART event
 # 81022-0713 - Added gathering of vicidial_inbound_groups stats(day only)
 # 81108-0808 - Added more inbound stats with some debug output and added campaign agent non-pause time
+# 90415-0925 - Fixed rare division by zero bug
 #

 # constants
@@ -1497,8 +1498,16 @@ if ( ($dial_method[$i] =~ /ADAPT_HARD_LIMIT|ADAPT_AVERAGE|ADAPT_TAPERED/) || ($f
        {
        # Calculate the optimal dial_level differential for the past minute
        $differential_target[$i] = ($differential_onemin[$i] + $adaptive_dl_diff_target[$i]);
-       $differential_mul[$i] = ($differential_target[$i] / $agents_average_onemin[$i]);
-       $differential_pct_raw[$i] = ($differential_mul[$i] * 100);
+       if ( ($differential_target[$i] != 0) && ($agents_average_onemin[$i] != 0) )
+               {
+               $differential_mul[$i] = ($differential_target[$i] / $agents_average_onemin[$i]);
+               $differential_pct_raw[$i] = ($differential_mul[$i] * 100);
+               }
+       else
+               {
+               $differential_mul[$i] = 0;
+               $differential_pct_raw[$i] = 0;
+               }
        $differential_pct[$i] = sprintf("%.2f", $differential_pct_raw[$i]);

        # Factor in the intensity setting

Re: # 90415-0925 - Fixed rare division by zero bug - questio

PostPosted: Sat Jun 15, 2013 3:42 pm
by bobbymc
the repo is a svn repo. how did you know what revision to check out and how did u check out the revision? im very familiar with git and hg but no svn =(

Re: # 90415-0925 - Fixed rare division by zero bug - questio

PostPosted: Mon Jun 17, 2013 3:46 am
by DomeDan
git works with svn too :)
Code: Select all
git svn clone svn://svn.eflo.net:3690/agc_2-X/trunk
tig #browse commits
git svn rebase #check for updates in trunk

and when I was looking for #90415-0925 I just checked the commits committed after 2009-04-15 09:25 using tig

Re: # 90415-0925 - Fixed rare division by zero bug - questio

PostPosted: Mon Jun 17, 2013 5:51 am
by bobbymc
sorry for the newb question but git apparently doesn't know about the svn command:

git: 'svn' is not a git-command. See 'git --help'.

Re: # 90415-0925 - Fixed rare division by zero bug - questio

PostPosted: Mon Jun 17, 2013 5:53 am
by bobbymc
sorry found it.. apt-get install git-svn

Re: # 90415-0925 - Fixed rare division by zero bug - questio

PostPosted: Mon Jun 17, 2013 5:56 am
by DomeDan
oh yeah forgot that you need to install that package