Fix bug in trySetPermitsAsync of RedissonPermitExpirableSemaphore

Fixes https://github.com/redisson/redisson/issues/4678 via the analogous change to 011be4160a in RedissonSemaphore

Signed-off-by: Kevin Scaldeferri <kevin@scaldeferri.com>
pull/4692/head
Kevin Scaldeferri 2 years ago committed by Kevin Scaldeferri
parent 1de67f7388
commit 08e998a3de

@ -654,7 +654,7 @@ public class RedissonPermitExpirableSemaphore extends RedissonExpirable implemen
public RFuture<Boolean> trySetPermitsAsync(int permits) {
return commandExecutor.evalWriteAsync(getRawName(), LongCodec.INSTANCE, RedisCommands.EVAL_BOOLEAN,
"local value = redis.call('get', KEYS[1]); " +
"if (value == false or value == 0) then "
"if (value == false) then "
+ "redis.call('set', KEYS[1], ARGV[1]); "
+ "redis.call('publish', KEYS[2], ARGV[1]); "
+ "return 1;"

Loading…
Cancel
Save