add lastUpdate to candle and max
This commit is contained in:
parent
b17c657863
commit
bcf0347002
@ -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 {
|
||||
|
1
maX.go
1
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)
|
||||
//校验时间戳是否合法
|
||||
|
Loading…
x
Reference in New Issue
Block a user