diff --git a/common/global_const/common_const.go b/common/global_const/common_const.go index fb5b7675..52370b1e 100644 --- a/common/global_const/common_const.go +++ b/common/global_const/common_const.go @@ -22,7 +22,7 @@ const ( ContextKeyApiMoDel = "api_model" StrategyStatusDisable StrategyStatus = "disable" - StrategyStatusAchieve StrategyStatus = "enable" + StrategyStatusAchive StrategyStatus = "enable" ) var ( diff --git a/common/price_compoent/price_util.go b/common/price_compoent/price_util.go index a1177e61..19f7378e 100644 --- a/common/price_compoent/price_util.go +++ b/common/price_compoent/price_util.go @@ -68,6 +68,10 @@ func GetPriceUsd(tokenType global_const.TokenType) (float64, error) { } defer func(Body io.ReadCloser) { + if p := recover(); p != nil { + logrus.Error("panic: ", p) + return + } if Body == nil { return } diff --git a/service/dashboard_service/dashboard_service.go b/service/dashboard_service/dashboard_service.go index fe4636e7..6b3fcbda 100644 --- a/service/dashboard_service/dashboard_service.go +++ b/service/dashboard_service/dashboard_service.go @@ -194,7 +194,7 @@ func GetSuitableStrategyWithOutCode(entryPointVersion global_const.EntrypointVer IsProjectErc20PayEnable: isPerc20Enable, }, ExecuteRestriction: &model.StrategyExecuteRestriction{ - Status: global_const.StrategyStatusAchieve, + Status: global_const.StrategyStatusAchive, }, Erc20TokenType: gasUseToken, } diff --git a/service/validator_service/basic_validator.go b/service/validator_service/basic_validator.go index d5c5a3bc..db5c10ef 100644 --- a/service/validator_service/basic_validator.go +++ b/service/validator_service/basic_validator.go @@ -33,7 +33,7 @@ func ValidateStrategy(strategy *model.Strategy, request *model.UserOpRequest) er if strategy.ExecuteRestriction == nil { return xerrors.Errorf("ExecuteRestriction is Empty") } - if strategy.ExecuteRestriction.Status != global_const.StrategyStatusAchieve { + if strategy.ExecuteRestriction.Status != global_const.StrategyStatusAchive { return xerrors.Errorf("strategy status is not active") } curTime := time.Now().Unix()