Skip to content

Commit

Permalink
add timeout to decider delegation
Browse files Browse the repository at this point in the history
addresses review comment ava-labs/icm-services#344 (comment)
  • Loading branch information
feuGeneA committed Jul 22, 2024
1 parent 6402790 commit e013687
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions messages/teleporter/message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,10 @@ func (m *messageHandler) deciderRejectedMessage() (bool, error) {
return false, err
}

// TODO: add a timeout to the context
ctx, cancelCtx := context.WithTimeout(context.Background(), 30*time.Second)
defer cancelCtx()
response, err := m.deciderClient.ShouldSendMessage(
context.Background(),
ctx,
&pbDecider.ShouldSendMessageRequest{
NetworkId: m.unsignedMessage.NetworkID,
SourceChainId: m.unsignedMessage.SourceChainID[:],
Expand Down

0 comments on commit e013687

Please sign in to comment.