From cc13effd644e3dcae41c990b00b51c04d42a8d0a Mon Sep 17 00:00:00 2001 From: Abhishek Chandrasekaran Date: Mon, 24 Aug 2020 09:05:39 -0700 Subject: [PATCH] change return type Signed-off-by: Abhishek Chandrasekaran --- .../src/main/java/org/redisson/RedissonRateLimiter.java | 8 ++++---- redisson/src/main/java/org/redisson/api/RRateLimiter.java | 4 +--- .../src/main/java/org/redisson/api/RRateLimiterAsync.java | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/redisson/src/main/java/org/redisson/RedissonRateLimiter.java b/redisson/src/main/java/org/redisson/RedissonRateLimiter.java index c9c9b63c3..97bf756f6 100644 --- a/redisson/src/main/java/org/redisson/RedissonRateLimiter.java +++ b/redisson/src/main/java/org/redisson/RedissonRateLimiter.java @@ -244,13 +244,13 @@ public class RedissonRateLimiter extends RedissonExpirable implements RRateLimit } @Override - public boolean setRate(RateType type, long rate, long rateInterval, RateIntervalUnit unit) { - return get(setRateAsync(type, rate, rateInterval, unit)); + public void setRate(RateType type, long rate, long rateInterval, RateIntervalUnit unit) { + setRateAsync(type, rate, rateInterval, unit); } @Override - public RFuture setRateAsync(RateType type, long rate, long rateInterval, RateIntervalUnit unit) { - return commandExecutor.evalWriteAsync(getName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN, + public RFuture setRateAsync(RateType type, long rate, long rateInterval, RateIntervalUnit unit) { + return commandExecutor.evalWriteAsync(getName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN, "redis.call('hset', KEYS[1], 'rate', ARGV[1]);" + "redis.call('hset', KEYS[1], 'interval', ARGV[2]);" + "redis.call('hset', KEYS[1], 'type', ARGV[3]);" diff --git a/redisson/src/main/java/org/redisson/api/RRateLimiter.java b/redisson/src/main/java/org/redisson/api/RRateLimiter.java index e21af5a29..2e7c72478 100644 --- a/redisson/src/main/java/org/redisson/api/RRateLimiter.java +++ b/redisson/src/main/java/org/redisson/api/RRateLimiter.java @@ -44,10 +44,8 @@ public interface RRateLimiter extends RRateLimiterAsync, RExpirable { * @param rate - rate * @param rateInterval - rate time interval * @param rateIntervalUnit - rate time interval unit - * @return {@code true} if rate was set and {@code false} - * otherwise */ - boolean setRate(RateType mode, long rate, long rateInterval, RateIntervalUnit rateIntervalUnit); + void setRate(RateType mode, long rate, long rateInterval, RateIntervalUnit rateIntervalUnit); /** * Acquires a permit only if one is available at the diff --git a/redisson/src/main/java/org/redisson/api/RRateLimiterAsync.java b/redisson/src/main/java/org/redisson/api/RRateLimiterAsync.java index dd29abcfc..691e15514 100644 --- a/redisson/src/main/java/org/redisson/api/RRateLimiterAsync.java +++ b/redisson/src/main/java/org/redisson/api/RRateLimiterAsync.java @@ -155,7 +155,7 @@ public interface RRateLimiterAsync extends RExpirableAsync { * @return {@code true} if rate was set and {@code false} * otherwise */ - RFuture setRateAsync(RateType mode, long rate, long rateInterval, RateIntervalUnit rateIntervalUnit); + RFuture setRateAsync(RateType mode, long rate, long rateInterval, RateIntervalUnit rateIntervalUnit); /** * Returns current configuration of this RateLimiter object.