Skip to content

Commit

Permalink
Avoids using context.Background() in transaction streamer
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoximenes committed Jan 15, 2025
1 parent da6022a commit 53701a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arbnode/transaction_streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ func (s *TransactionStreamer) GetProcessedMessageCount() (arbutil.MessageIndex,
if err != nil {
return 0, err
}
digestedHead, err := s.exec.HeadMessageNumber().Await(context.Background())
digestedHead, err := s.exec.HeadMessageNumber().Await(s.GetContext())
if err != nil {
return 0, err
}
Expand Down Expand Up @@ -1093,7 +1093,11 @@ func (s *TransactionStreamer) ResultAtCount(count arbutil.MessageIndex) (*execut
}
log.Info(FailedToGetMsgResultFromDB, "count", count)

msgResult, err := s.exec.ResultAtPos(pos).Await(context.Background())
ctx := context.Background()
if s.Started() {
ctx = s.GetContext()
}
msgResult, err := s.exec.ResultAtPos(pos).Await(ctx)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 53701a7

Please sign in to comment.