Closed rvit34 closed 2 years ago
Hi @rvit34
Thank you for listing this case for us, but I'm afraid this is expected behaviour.
The documentation for changeLimitForPeriod
method provides an explanation:
NOTE! New limit won't affect current period permissions and will apply only from next one.
/**
* Dynamic rate limiter configuration change. This method allows to change count of permissions
* available during refresh period. NOTE! New limit won't affect current period permissions and
* will apply only from next one.
*
* @param limitForPeriod new permissions limit
*/
void changeLimitForPeriod(int limitForPeriod);
It would be useful, especially in tests, to don't wait for the next period. Is it possible to add optional argument to the method to apply new limit immediately?
@rvit34 I agree, this would be a convenient feature. Would you like to create PR?
Resilience4j version: 1.5.0
Java version: 1.8
This test reproduces the issue: