Remove 5 second wait starting MsgListenerContainer

with no listeners

DATAREDIS-207
This commit is contained in:
Jennifer Hickey
2013-07-26 13:59:10 -04:00
parent 94c4a0eed1
commit 9255ae57ad
2 changed files with 19 additions and 5 deletions

View File

@@ -190,11 +190,13 @@ public class RedisMessageListenerContainer implements InitializingBean, Disposab
// technically speaking we can only be notified right before the subscription starts
synchronized (monitor) {
lazyListen();
try {
// wait up to 5 seconds
monitor.wait(initWait);
} catch (InterruptedException e) {
// stop waiting
if(listening) {
try {
// wait up to 5 seconds for Subscription thread
monitor.wait(initWait);
} catch (InterruptedException e) {
// stop waiting
}
}
}