This commit is contained in:
yangduo 2024-08-20 17:32:50 +08:00
parent 13586dd0d5
commit 8ad879c3ee

View File

@ -20,6 +20,7 @@ type accountContribution struct {
type contribution struct { type contribution struct {
historyContribution float64 historyContribution float64
rechargeContribution float64
globalContribution float64 globalContribution float64
gcTime int64 gcTime int64
@ -204,8 +205,7 @@ func (this *contribution) GetAddressContribution(accountAddress string, onlyrech
} }
if ds.Next() { if ds.Next() {
tmp, _ := q5.ToFloat64Ex(ds.GetByIndex(0)) (*accinfo).rechargeContri, _ = q5.ToFloat64Ex(ds.GetByIndex(0))
(*accinfo).rechargeContri = tmp
} }
}) })
} }
@ -290,11 +290,11 @@ func (this *contribution) GetGlobalContribution(instant bool) (float64, error) {
} }
if ds.Next() { if ds.Next() {
tmp, _ := q5.ToFloat64Ex(ds.GetByIndex(0)) this.rechargeContribution, _ = q5.ToFloat64Ex(ds.GetByIndex(0))
this.globalContribution += tmp
} }
}) })
this.globalContribution += this.rechargeContribution
this.globalContribution += this.historyContribution this.globalContribution += this.historyContribution
this.gcTime = nowseconds this.gcTime = nowseconds
} }
@ -322,7 +322,15 @@ func (this *contribution) checkContributionList() {
} }
this.accountContributionlist.Delete(account) 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))
} }
} }