shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

[Question] <Resilience4JPlugin's conf limitForPeriod invalid>

Open MetalCodeBand opened this issue 5 years ago • 2 comments

Question

I test resilience4J plugin, and set limitForPeriod 2 for RuleData, but it was changed 50 in org.apache.shenyu.common.dto.convert.Resilience4JHandle#checkData() : 393 :

resilience4JHandle.setLimitForPeriod(Math.max(resilience4JHandle.getLimitForPeriod(), Constants.LIMIT_FOR_PERIOD));

If I went to limit 2 request per second, it will failed.

I think it should be fix to:

resilience4JHandle.setLimitForPeriod(Math.min(resilience4JHandle.getLimitForPeriod(), Constants.LIMIT_FOR_PERIOD));

So It is a bug or the way I used has problem?

MetalCodeBand avatar Sep 12 '21 06:09 MetalCodeBand

Hi, Perhaps this method named 'checkData' is not reasonable,you are right,can you provide a pr fix this bug or remove the 'checkData' method directly

SaberSola avatar Sep 12 '21 06:09 SaberSola

Of course, I will fix it.

MetalCodeBand avatar Sep 12 '21 07:09 MetalCodeBand