Skip to content

Commit

Permalink
handle error while sending in batch
Browse files Browse the repository at this point in the history
  • Loading branch information
Duong Minh Ngoc committed Jan 17, 2024
1 parent b334298 commit a6a6fcf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions x/feeabs/keeper/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ func (k Keeper) handleOsmosisIbcQuery(ctx sdk.Context) error {
batchSize := 10
var reqs []types.QueryArithmeticTwapToNowRequest
batchCounter := 0
var errorFound error
k.IterateHostZone(ctx, func(hostZoneConfig types.HostChainFeeAbsConfig) (stop bool) {
if hostZoneConfig.Frozen {
return false
Expand All @@ -289,6 +290,7 @@ func (k Keeper) handleOsmosisIbcQuery(ctx sdk.Context) error {
if batchCounter == batchSize {
err := k.SendOsmosisQueryRequest(ctx, reqs, types.IBCPortID, params.IbcQueryIcqChannel)
if err != nil {
errorFound = err
return true
}
reqs = []types.QueryArithmeticTwapToNowRequest{}
Expand All @@ -297,6 +299,10 @@ func (k Keeper) handleOsmosisIbcQuery(ctx sdk.Context) error {
return false
})

if errorFound != nil {
return errorFound
}

if len(reqs) > 0 {
err := k.SendOsmosisQueryRequest(ctx, reqs, types.IBCPortID, params.IbcQueryIcqChannel)
if err != nil {
Expand Down

0 comments on commit a6a6fcf

Please sign in to comment.