2
0

Merge pull request #23 from kevin96666/issue-22

SubscribeHandler not working with NonVerbose mode
This commit is contained in:
Lucas Löffel
2020-02-14 08:58:08 +01:00
committed by GitHub
+4 -5
View File
@@ -407,21 +407,20 @@ func (rc *RecConn) connect() {
if err == nil { if err == nil {
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.hasSubscribeHandler() {
return
} }
if rc.hasSubscribeHandler() {
if err := rc.SubscribeHandler(); err != nil { if err := rc.SubscribeHandler(); err != nil {
log.Fatalf("Dial: connect handler failed with %s", err.Error()) log.Fatalf("Dial: connect handler failed with %s", err.Error())
} }
if !rc.getNonVerbose() {
log.Printf("Dial: connect handler was successfully established with %s\n", rc.url) log.Printf("Dial: connect handler was successfully established with %s\n", rc.url)
}
}
if rc.getKeepAliveTimeout() != 0 { if rc.getKeepAliveTimeout() != 0 {
rc.keepAlive() rc.keepAlive()
} }
}
return return
} }