Merge pull request #347 from fredericBregier/3
3 Proposal to fix 1rst issue presented in #345
This commit is contained in:
commit
35d6d682df
|
@ -358,7 +358,7 @@ public abstract class AbstractTrafficShapingHandler extends
|
|||
// Time is too short, so just lets continue
|
||||
return 0;
|
||||
}
|
||||
return bytes * 1000 / limit - interval;
|
||||
return ((bytes * 1000 / limit - interval)/10)*10;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -247,9 +247,10 @@ public class TrafficCounter {
|
|||
* @param newcheckInterval
|
||||
*/
|
||||
public void configure(long newcheckInterval) {
|
||||
if (checkInterval.get() != newcheckInterval) {
|
||||
checkInterval.set(newcheckInterval);
|
||||
if (newcheckInterval <= 0) {
|
||||
long newInterval = (newcheckInterval/10)*10;
|
||||
if (checkInterval.get() != newInterval) {
|
||||
checkInterval.set(newInterval);
|
||||
if (newInterval <= 0) {
|
||||
stop();
|
||||
// No more active monitoring
|
||||
lastTime.set(System.currentTimeMillis());
|
||||
|
|
Loading…
Reference in New Issue
Block a user