From ae1554a7b52d187b3a2b5f6c5bbd83bea5d8be02 Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Wed, 18 Dec 2024 15:33:14 +0800 Subject: [PATCH] add lastUpdate to candle and max --- candle.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/candle.go b/candle.go index 254130e..954de99 100644 --- a/candle.go +++ b/candle.go @@ -187,10 +187,7 @@ func (core *Core) SaveCandle(instId string, period string, rsp *CandleData, dura From: "rest", LastUpdate: time.Now(), } - data := candle.Data - tsi, _ := strconv.ParseInt(data[0].(string), 10, 64) - tm, _ := Int64ToTime(tsi) - candle.Timestamp = tm + //存到elasticSearch candle.PushToWriteLogChan(core) //保存rest得到的candle @@ -214,7 +211,10 @@ func (candle *Candle) PushToWriteLogChan(cr *Core) error { candle.Id = HashString(did) ncd, _ := candle.ToStruct(cr) fmt.Println("ncd: ", ncd) - cd, _ := json.Marshal(ncd) + cd, err := json.Marshal(ncd) + if err != nil { + fmt.Println("PushToWriteLog json marshal candle err: ", err) + } candle = ncd wg := WriteLog{ Content: cd,