From bcf03470022f02d0086ce157c8e1c9e4aaf473c8 Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Wed, 18 Dec 2024 13:32:49 +0800 Subject: [PATCH] add lastUpdate to candle and max --- candle.go | 2 +- maX.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/candle.go b/candle.go index 792764f..11d4e73 100644 --- a/candle.go +++ b/candle.go @@ -455,7 +455,7 @@ func (cl *Candle) SetToKey(core *Core) ([]interface{}, error) { tss := strconv.FormatInt(tsi, 10) keyName := "candle" + cl.Period + "|" + cl.InstID + "|ts:" + tss //过期时间:根号(当前candle的周期/1分钟)*10000 - + cl.LastUpdate = time.Now() dt, err := json.Marshal(cl) exp, err := core.PeriodToMinutes(cl.Period) if err != nil { diff --git a/maX.go b/maX.go index e4410ee..b2edd1a 100644 --- a/maX.go +++ b/maX.go @@ -38,6 +38,7 @@ type WillMX struct { func (mx MaX) SetToKey(cr *Core) ([]interface{}, error) { // fmt.Println(utils.GetFuncName(), " step1 ", mx.InstID, " ", mx.Period) mx.Timestamp, _ = Int64ToTime(mx.Ts) + mx.LastUpdate = time.Now() cstr := strconv.Itoa(mx.Count) tss := strconv.FormatInt(mx.Ts, 10) //校验时间戳是否合法