Subject: | Lag retries erroneously reported as 1 |
Date: | Mon, 02 Feb 2015 07:46:52 +0100 |
To: | bug-MediaWiki-API [...] rt.cpan.org |
From: | Derbeth <derbeth [...] interia.pl> |
In "sub api" you will always print "1" as the number of attempts, no matter what the configuration is:
if ($maxlagretries == 0) {
return $self->_error(ERR_API,"Server has reported lag above the configure max_lag value of " . $self->{config}->{max_lag} . " value after " .($maxlagretries+1)." attempt(s). Last reported lag was - ". $ref->{'error'}->{'info'})
}
Naturally, this code gets executed only if $maxlagretries is zero, so you will print 1 as the number of attempts. You loose the original value of this configuration parameter, because you modify the variable in each loop execution.
You should use an another variable for counting attempts number instead of decreasing $maxlagretries and never modify $maxlagretries.