diff --git a/internal/services/unbonding_pipeline.go b/internal/services/unbonding_pipeline.go index 2f59bfd..3c8d5e1 100644 --- a/internal/services/unbonding_pipeline.go +++ b/internal/services/unbonding_pipeline.go @@ -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 { @@ -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 } @@ -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 { @@ -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 }