Browse Source

update 添加 logIds 保护

dev
lucas 1 week ago
parent
commit
5d47a57b16
  1. 3
      dbOperate/elasticsearchHelper.go

3
dbOperate/elasticsearchHelper.go

@ -281,12 +281,13 @@ func (the *ESHelper) BulkWriteRaws2Es(index string, raws []models.EsRaw, logIds
%s %s
`, index, _id, source) `, index, _id, source)
body.WriteString(s) body.WriteString(s)
if len(logIds) > 0 {
if raw.IotaDevice == logIds[0] { if raw.IotaDevice == logIds[0] {
log.Printf("BulkWriteRaws2Es 标记设备数据 [%s] %s ", raw.IotaDevice, s) log.Printf("BulkWriteRaws2Es 标记设备数据 [%s] %s ", raw.IotaDevice, s)
logTag = true logTag = true
} }
} }
}
if logTag { //追踪数据 if logTag { //追踪数据
the.BulkWriteWithLog(index, body.String()) the.BulkWriteWithLog(index, body.String())
} else { } else {

Loading…
Cancel
Save