add lastUpdate to candle and max

This commit is contained in:
zhangkun9038@dingtalk.com 2024-12-18 16:40:18 +08:00
parent 0cc94d2e5d
commit 2ec9627fe6

View File

@ -179,12 +179,14 @@ func IsModOf(curInt int64, duration time.Duration) bool {
func (core *Core) SaveCandle(instId string, period string, rsp *CandleData, dura time.Duration, withWs bool) {
leng := len(rsp.Data)
for _, v := range rsp.Data {
tmi := ToInt64(v[0])
ts, _ := Int64ToTime(tmi)
candle := Candle{
InstID: instId,
Period: period,
Data: v,
From: "rest",
Timestamp: ts,
LastUpdate: time.Now(),
}