Fixed exception during channel re-subscription. #87

pull/92/head
Nikita 10 years ago
parent 57dc4fcde7
commit f80a6794e7

@ -79,7 +79,8 @@ public class RedissonCountDownLatch extends RedissonObject implements RCountDown
@Override
public void subscribed(String channel, long count) {
if (getChannelName().equals(channel)) {
if (getChannelName().equals(channel)
&& !value.getPromise().isSuccess()) {
value.getPromise().setSuccess(true);
}
}

@ -178,7 +178,8 @@ public class RedissonLock extends RedissonObject implements RLock {
@Override
public void subscribed(String channel, long count) {
if (getChannelName().equals(channel)) {
if (getChannelName().equals(channel)
&& !value.getPromise().isSuccess()) {
value.getPromise().setSuccess(true);
}
}

@ -41,7 +41,7 @@ public class RedissonLockTest extends BaseConcurrentTest {
RLock lock1 = redisson.getLock("lock");
lock1.lock();
long spendTime = System.currentTimeMillis() - startTime;
Assert.assertTrue(spendTime < 2005);
Assert.assertTrue(spendTime < 2010);
lock1.unlock();
latch.countDown();
};

Loading…
Cancel
Save