When an error occurs in executing a Lua script, the log is printed as error (#3502)

Co-authored-by: huangyb <huangyb@akulaku.com>
This commit is contained in:
jmilktea
2024-09-26 00:39:47 +08:00
committed by GitHub
parent 4edd3b13aa
commit c59e1909ad

View File

@@ -253,9 +253,7 @@ public class RedisRateLimiter extends AbstractRateLimiter<RedisRateLimiter.Confi
Flux<List<Long>> flux = this.redisTemplate.execute(this.script, keys, scriptArgs);
// .log("redisratelimiter", Level.FINER);
return flux.onErrorResume(throwable -> {
if (log.isDebugEnabled()) {
log.debug("Error calling rate limiter lua", throwable);
}
log.error("Error calling rate limiter lua", throwable);
return Flux.just(Arrays.asList(1L, -1L));
}).reduce(new ArrayList<Long>(), (longs, l) -> {
longs.addAll(l);