From 9cfe34ea181e5b4438a39312a9d4c5c80b60353c Mon Sep 17 00:00:00 2001 From: lucas Date: Tue, 15 Oct 2024 13:52:57 +0800 Subject: [PATCH] =?UTF-8?q?update=20=20go=20kafka=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node/et_worker/et_recv/recvDataHanler.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node/et_worker/et_recv/recvDataHanler.go b/node/et_worker/et_recv/recvDataHanler.go index b3a55b7..6100086 100644 --- a/node/et_worker/et_recv/recvDataHanler.go +++ b/node/et_worker/et_recv/recvDataHanler.go @@ -31,7 +31,7 @@ func Recover(deviceId string, structId int, alarmType string, time time.Time) { } jsonOut, _ := json.Marshal(alarm) brokers := configLoad.LoadConfig().GetStringSlice("kafka.brokers") - kafkaHelper.Send2Topic(brokers, "native_alarm", string(jsonOut)) + go kafkaHelper.Send2Topic(brokers, "native_alarm", string(jsonOut)) } func AlarmToOut(deviceId string, structId int, alarmType string, time time.Time, subDevices []string) { alarm := common_models.AlarmMsg{ @@ -51,7 +51,7 @@ func AlarmToOut(deviceId string, structId int, alarmType string, time time.Time, } jsonOut, _ := json.Marshal(alarm) brokers := configLoad.LoadConfig().GetStringSlice("kafka.brokers") - kafkaHelper.Send2Topic(brokers, "native_alarm", string(jsonOut)) + go kafkaHelper.Send2Topic(brokers, "native_alarm", string(jsonOut)) } func AlarmDtuToOut(device *common_models.DeviceInfo, alarmType, alarmCode, content string, time time.Time, subDevices []string) { alarm := common_models.AlarmMsg{ @@ -71,7 +71,7 @@ func AlarmDtuToOut(device *common_models.DeviceInfo, alarmType, alarmCode, conte } jsonOut, _ := json.Marshal(alarm) brokers := configLoad.LoadConfig().GetStringSlice("kafka.brokers") - kafkaHelper.Send2Topic(brokers, "native_alarm", string(jsonOut)) + go kafkaHelper.Send2Topic(brokers, "native_alarm", string(jsonOut)) } type RecvDataHanler struct {