Skip to content

Commit a519468

Browse files
fix(hive): remove unused context
1 parent c5fbf5a commit a519468

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

pkg/hive/hive.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ import (
3535
const loggerName = "hive"
3636

3737
const (
38-
protocolName = "hive"
39-
protocolVersion = "1.1.0"
40-
peersStreamName = "peers"
41-
messageTimeout = 1 * time.Minute // maximum allowed time for a message to be read or written.
42-
maxBatchSize = 30
43-
batchValidationTimeout = 5 * time.Minute // prevent lock contention on peer validation
38+
protocolName = "hive"
39+
protocolVersion = "1.1.0"
40+
peersStreamName = "peers"
41+
messageTimeout = 1 * time.Minute // maximum allowed time for a message to be read or written.
42+
maxBatchSize = 30
4443
)
4544

4645
var (
@@ -261,16 +260,14 @@ func (s *Service) startCheckPeersHandler() {
261260
return
262261
case newPeers := <-s.peersChan:
263262
s.wg.Go(func() {
264-
cctx, cancel := context.WithTimeout(ctx, batchValidationTimeout)
265-
defer cancel()
266-
s.checkAndAddPeers(cctx, newPeers)
263+
s.checkAndAddPeers(newPeers)
267264
})
268265
}
269266
}
270267
})
271268
}
272269

273-
func (s *Service) checkAndAddPeers(ctx context.Context, peers pb.Peers) {
270+
func (s *Service) checkAndAddPeers(peers pb.Peers) {
274271
var peersToAdd []swarm.Address
275272

276273
for _, p := range peers.Peers {

0 commit comments

Comments
 (0)