Browse code

nats: fix the nats:connected event_route not being triggered on a successful connect

Seven Du authored on 19/06/2022 11:42:18 • Henning Westerholt committed on 20/06/2022 17:16:13
Showing 1 changed files
... ...
@@ -298,7 +298,10 @@ int _nats_pub_worker_proc(
298 298
 			!= NATS_OK) {
299 299
 		LM_ERR("could not connect to nats servers [%s]\n",
300 300
 				natsStatus_GetText(s));
301
+	} else {
302
+		connectedCB(worker->nc->conn, NULL);
301 303
 	}
304
+
302 305
 	s = natsOptions_SetEventLoop(worker->nc->opts, (void *)worker->uvLoop,
303 306
 			natsLibuv_Attach, natsLibuv_Read, natsLibuv_Write,
304 307
 			natsLibuv_Detach);