Skip to content

Commit 0f8da6b

Browse files
Push metrics when there is no unbonding txs
2 parents 98ad1d6 + 03c3db5 commit 0f8da6b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

internal/services/unbonding_pipeline.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,6 @@ func (up *UnbondingPipeline) ProcessNewTransactions(ctx context.Context) error {
374374
return err
375375
}
376376

377-
if len(unbondingTransactions) == 0 {
378-
up.logger.Info("No unbonding new transactions to process")
379-
return nil
380-
}
381-
382377
defer func() {
383378
if up.Metrics.Config.Enabled {
384379
if err := up.pushMetrics(); err != nil {
@@ -387,6 +382,11 @@ func (up *UnbondingPipeline) ProcessNewTransactions(ctx context.Context) error {
387382
}
388383
}()
389384

385+
if len(unbondingTransactions) == 0 {
386+
up.logger.Info("No unbonding new transactions to process")
387+
return nil
388+
}
389+
390390
if err := up.processUnbondingTransactions(ctx, unbondingTransactions); err != nil {
391391
return err
392392
}
@@ -404,11 +404,6 @@ func (up *UnbondingPipeline) ProcessFailedTransactions(ctx context.Context) erro
404404
return err
405405
}
406406

407-
if len(unbondingTransactions) == 0 {
408-
up.logger.Info("No failed unbonding transactions to process")
409-
return nil
410-
}
411-
412407
defer func() {
413408
if up.Metrics.Config.Enabled {
414409
if err := up.pushMetrics(); err != nil {
@@ -417,6 +412,11 @@ func (up *UnbondingPipeline) ProcessFailedTransactions(ctx context.Context) erro
417412
}
418413
}()
419414

415+
if len(unbondingTransactions) == 0 {
416+
up.logger.Info("No failed unbonding transactions to process")
417+
return nil
418+
}
419+
420420
if err := up.processUnbondingTransactions(ctx, unbondingTransactions); err != nil {
421421
return err
422422
}

0 commit comments

Comments
 (0)