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) //校验时间戳是否合法