From 44a2380e89d38234932ccc3e99ef1f7b23d18ac9 Mon Sep 17 00:00:00 2001 From: naiba Date: Sat, 6 Nov 2021 18:52:10 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20int64=20=E5=AF=BC=E8=87=B4=20sec?= =?UTF-8?q?onds=20=E6=B0=B8=E8=BF=9C=E4=B8=BA=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/rule.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/rule.go b/model/rule.go index 7ed6112..b504534 100644 --- a/model/rule.go +++ b/model/rule.go @@ -123,7 +123,7 @@ func (u *Rule) Snapshot(cycleTransferStats *CycleTransferStats, server *Server, // 循环区间流量检测 · 更新下次需要检测时间 if u.IsTransferDurationRule() { - seconds := 1800 * time.Duration(((u.Max - src) / u.Max)) + seconds := 1800 * ((u.Max - src) / u.Max) if seconds < 180 { seconds = 180 } @@ -133,7 +133,7 @@ func (u *Rule) Snapshot(cycleTransferStats *CycleTransferStats, server *Server, if u.LastCycleStatus == nil { u.LastCycleStatus = make(map[uint64]interface{}) } - u.NextTransferAt[server.ID] = time.Now().Add(time.Duration(time.Second * seconds)) + u.NextTransferAt[server.ID] = time.Now().Add(time.Second * time.Duration(seconds)) if (u.Max > 0 && src > u.Max) || (u.Min > 0 && src < u.Min) { u.LastCycleStatus[server.ID] = struct{}{} } else {