From e10569b0c0592f5cc8d959e420e3790e53f06db9 Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Wed, 18 Dec 2024 16:45:18 +0800 Subject: [PATCH] add lastUpdate to candle and max --- candle.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/candle.go b/candle.go index 9d70191..688c614 100644 --- a/candle.go +++ b/candle.go @@ -457,9 +457,12 @@ func (cl *Candle) SetToKey(core *Core) ([]interface{}, error) { data := cl.Data tsi, err := strconv.ParseInt(data[0].(string), 10, 64) tss := strconv.FormatInt(tsi, 10) + tm, _ := Int64ToTime(tsi) + keyName := "candle" + cl.Period + "|" + cl.InstID + "|ts:" + tss //过期时间:根号(当前candle的周期/1分钟)*10000 cl.LastUpdate = time.Now() + cl.Timestamp = tm dt, err := json.Marshal(cl) if err != nil { fmt.Println("candle Save to String err:", err)