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 {