added hasSubscribeHandler
This commit is contained in:
@@ -280,6 +280,13 @@ func (rc *RecConn) getBackoff() *backoff.Backoff {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rc *RecConn) hasSubscribeHandler() bool {
|
||||||
|
rc.mu.RLock()
|
||||||
|
defer rc.mu.RUnlock()
|
||||||
|
|
||||||
|
return rc.SubscribeHandler != nil
|
||||||
|
}
|
||||||
|
|
||||||
func (rc *RecConn) connect() {
|
func (rc *RecConn) connect() {
|
||||||
b := rc.getBackoff()
|
b := rc.getBackoff()
|
||||||
|
|
||||||
@@ -302,7 +309,7 @@ func (rc *RecConn) connect() {
|
|||||||
if !rc.getNonVerbose() {
|
if !rc.getNonVerbose() {
|
||||||
log.Printf("Dial: connection was successfully established with %s\n", rc.url)
|
log.Printf("Dial: connection was successfully established with %s\n", rc.url)
|
||||||
|
|
||||||
if rc.SubscribeHandler == nil {
|
if !rc.hasSubscribeHandler() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user