From 8ad879c3eede9a911e5c6577c5f79d0d40b28765 Mon Sep 17 00:00:00 2001 From: yangduo Date: Tue, 20 Aug 2024 17:32:50 +0800 Subject: [PATCH] log --- server/marketserver/service/contribution.go | 24 ++++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/server/marketserver/service/contribution.go b/server/marketserver/service/contribution.go index 382045f4..0dbcf3b0 100644 --- a/server/marketserver/service/contribution.go +++ b/server/marketserver/service/contribution.go @@ -19,9 +19,10 @@ type accountContribution struct { } type contribution struct { - historyContribution float64 - globalContribution float64 - gcTime int64 + historyContribution float64 + rechargeContribution float64 + globalContribution float64 + gcTime int64 accountContributionlist q5.ConcurrentMap[string, *accountContribution] emailContributionlist q5.ConcurrentMap[string, *accountContribution] @@ -204,8 +205,7 @@ func (this *contribution) GetAddressContribution(accountAddress string, onlyrech } if ds.Next() { - tmp, _ := q5.ToFloat64Ex(ds.GetByIndex(0)) - (*accinfo).rechargeContri = tmp + (*accinfo).rechargeContri, _ = q5.ToFloat64Ex(ds.GetByIndex(0)) } }) } @@ -290,11 +290,11 @@ func (this *contribution) GetGlobalContribution(instant bool) (float64, error) { } if ds.Next() { - tmp, _ := q5.ToFloat64Ex(ds.GetByIndex(0)) - this.globalContribution += tmp + this.rechargeContribution, _ = q5.ToFloat64Ex(ds.GetByIndex(0)) } }) + this.globalContribution += this.rechargeContribution this.globalContribution += this.historyContribution this.gcTime = nowseconds } @@ -322,7 +322,15 @@ func (this *contribution) checkContributionList() { } this.accountContributionlist.Delete(account) } + f5.GetSysLog().Info("delete contribution address cache count:%d", len(deletelist)) } - time.Sleep((time.Second * 1800)) + + f5.GetSysLog().Info("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<") + f5.GetSysLog().Info("contribution cache total:%.2f, recharge:%.2f, history:%.2f", + this.globalContribution, + this.rechargeContribution, + this.historyContribution) + f5.GetSysLog().Info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>") + time.Sleep((time.Second * 60)) } }