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