Skip to content

Commit

Permalink
Push metrics when there is no unbonding txs
Browse files Browse the repository at this point in the history
  • Loading branch information
hiepmai-babylonchain authored Jun 3, 2024
2 parents 98ad1d6 + 03c3db5 commit 0f8da6b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions internal/services/unbonding_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,6 @@ func (up *UnbondingPipeline) ProcessNewTransactions(ctx context.Context) error {
return err
}

if len(unbondingTransactions) == 0 {
up.logger.Info("No unbonding new transactions to process")
return nil
}

defer func() {
if up.Metrics.Config.Enabled {
if err := up.pushMetrics(); err != nil {
Expand All @@ -387,6 +382,11 @@ func (up *UnbondingPipeline) ProcessNewTransactions(ctx context.Context) error {
}
}()

if len(unbondingTransactions) == 0 {
up.logger.Info("No unbonding new transactions to process")
return nil
}

if err := up.processUnbondingTransactions(ctx, unbondingTransactions); err != nil {
return err
}
Expand All @@ -404,11 +404,6 @@ func (up *UnbondingPipeline) ProcessFailedTransactions(ctx context.Context) erro
return err
}

if len(unbondingTransactions) == 0 {
up.logger.Info("No failed unbonding transactions to process")
return nil
}

defer func() {
if up.Metrics.Config.Enabled {
if err := up.pushMetrics(); err != nil {
Expand All @@ -417,6 +412,11 @@ func (up *UnbondingPipeline) ProcessFailedTransactions(ctx context.Context) erro
}
}()

if len(unbondingTransactions) == 0 {
up.logger.Info("No failed unbonding transactions to process")
return nil
}

if err := up.processUnbondingTransactions(ctx, unbondingTransactions); err != nil {
return err
}
Expand Down

0 comments on commit 0f8da6b

Please sign in to comment.