Skip to content

Commit

Permalink
log when stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
hamdiallam committed Oct 18, 2024
1 parent 6fc46a0 commit 4a0ef49
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions op-txproxy/txproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,20 @@ func (txp *TxProxy) Start(_ context.Context) error {

func (txp *TxProxy) Stop(ctx context.Context) error {
var result error

if txp.rpcSrv != nil {
txp.log.Info("stopping rpc server")
if err := txp.rpcSrv.Stop(); err != nil {
result = errors.Join(result, fmt.Errorf("failed to stop metrics server: %w", err))
}
}
if txp.metricsSrv != nil {
txp.log.Info("stopping metrics server")
if err := txp.metricsSrv.Stop(ctx); err != nil {
result = errors.Join(result, fmt.Errorf("failed to stop metrics server: %w", err))
}
}

return result
}

Expand Down

0 comments on commit 4a0ef49

Please sign in to comment.