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 }