尝试给上报到elasticsearch的文档加_id

This commit is contained in:
zhangkun 2024-12-04 13:16:17 +08:00
parent 46a2136617
commit d55afe2b85
3 changed files with 8 additions and 7 deletions

View File

@ -284,14 +284,14 @@ func (core *Core) SaveUniKey(period string, keyName string, extt time.Duration,
did := cl.InstId + cl.Period + cl.Data[0].(string)
cl.Id = hashString(did)
cl.ToStruct(core)
// cd, _ := json.Marshal(cl)
// wg := WriteLog{
// Content: cd,
// Tag: "sardine.log.candle." + cl.Period,
// Id: hashString(did),
// }
cd, _ := json.Marshal(cl)
wg := WriteLog{
Content: cd,
Tag: "sardine.log.candle." + cl.Period,
Id: hashString(did),
}
// go func() {
// core.WriteLogChan <- &wg
core.WriteLogChan <- &wg
// }()
// err = wg.Process(core)

View File

@ -112,6 +112,7 @@ func (core *Core) Init() {
cli, err := core.GetRedisCli()
core.RedisCli = cli
core.RestQueueChan = make(chan *RestQueue)
core.WriteLogChan = make(chan *WriteLog)
core.OrderChan = make(chan *private.Order)
if err != nil {
fmt.Println("init redis client err: ", err)

BIN
tunas

Binary file not shown.