Skip to content

Commit 720f8c9

Browse files
committed
Move writes to blockChan in a select case to avoid blocking
1 parent 97550d2 commit 720f8c9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

services/requester/keystore/key_store.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,11 @@ func (k *KeyStore) NotifyBlock(blockHeader flowsdk.BlockHeader) {
116116
k.logger.Warn().Msg(
117117
"received `NotifyBlock` while the server is shutting down",
118118
)
119-
return
120-
default:
121-
k.blockChan <- blockHeader
119+
case k.blockChan <- blockHeader:
120+
k.logger.Info().Msgf(
121+
"received `NotifyBlock` for block with ID: %s",
122+
blockHeader.ID,
123+
)
122124
}
123125
}
124126

0 commit comments

Comments
 (0)