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
+8 -9
View File
@@ -407,22 +407,21 @@ 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() { if rc.hasSubscribeHandler() {
return
}
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 {
rc.keepAlive()
} }
} }
if rc.getKeepAliveTimeout() != 0 {
rc.keepAlive()
}
return return
} }