This commit is contained in:
aozhiwei 2024-06-27 16:28:00 +08:00
parent dcdccd9ac6
commit 1a68b97855
2 changed files with 5 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
_ "main/app" _ "main/app"
. "main/global" . "main/global"
_ "main/task" _ "main/task"
_ "main/service"
) )
func Init() { func Init() {

View File

@ -8,6 +8,7 @@ import (
"math/big" "math/big"
"mt" "mt"
"strings" "strings"
"fmt"
) )
const DECIMALS = 10000 const DECIMALS = 10000
@ -59,11 +60,13 @@ func (this *bcCurrency) ExchangeUSD(amount string, itemType string, contractAddr
func (this *bcCurrency) refreshExchangeRate() () { func (this *bcCurrency) refreshExchangeRate() () {
for true { for true {
f5.GetSysLog().Info("bcCurrency refreshPrice1")
rspObj := []vsCurrency{} rspObj := []vsCurrency{}
f5.GetHttpCliMgr().SendGoStyleRequest( f5.GetHttpCliMgr().SendGoStyleRequest(
jccommon.BC_CURRENCY_VS_URL, jccommon.BC_CURRENCY_VS_URL,
map[string]string{}, map[string]string{},
func (rsp f5.HttpCliResponse) { func (rsp f5.HttpCliResponse) {
fmt.Println("bcCurrency refreshPrice22", rsp.GetErr())
if rsp.GetErr() != nil { if rsp.GetErr() != nil {
return return
} }
@ -71,6 +74,7 @@ func (this *bcCurrency) refreshExchangeRate() () {
this.updatePrice(rspObj) this.updatePrice(rspObj)
} }
}) })
f5.GetSysLog().Info("bcCurrency refreshPrice2")
if f5.IsOnlineEnv() { if f5.IsOnlineEnv() {
time.Sleep(time.Second * 60 * 10) time.Sleep(time.Second * 60 * 10)
} else { } else {