From 1a7819e7033b097c58e9ecba36eea310d939965e Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Thu, 23 Jan 2025 12:00:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=EF=BC=9Ahttp://gitea.zjmod.x?= =?UTF-8?q?yz/phyer/core/issues/2#issue-2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- candle.go | 4 +++- core.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/candle.go b/candle.go index 85d209c..77c7860 100644 --- a/candle.go +++ b/candle.go @@ -534,7 +534,9 @@ func (cl *Candle) SetToKey(core *Core) ([]interface{}, error) { logrus.Error("err of PeriodToMinutes:", err) } // expf := float64(exp) * 60 - expf := float64(exp) * 300 + length, _ := core.Cfg.Config.Get("sortedSet").Get("length").String() + ln := ToFloat64(length) + expf := float64(exp) * ln extt := time.Duration(expf) * time.Minute curVolstr, _ := data[5].(string) curVol, err := strconv.ParseFloat(curVolstr, 64) diff --git a/core.go b/core.go index 879d382..a5c6917 100644 --- a/core.go +++ b/core.go @@ -699,7 +699,9 @@ func (cr *Core) GetExpiration(per string) (time.Duration, error) { return 0, err } exp, err := cr.PeriodToMinutes(per) - dur := time.Duration(exp*300) * time.Minute + length, _ := cr.Cfg.Config.Get("sortedSet").Get("length").String() + ln := ToInt64(length) + dur := time.Duration(exp*ln) * time.Minute return dur, err }