@cryptotaxi247 / kubo / commits / d786a69e7

Remove timeout from provide context

This is being removed because it appears that the provide announcements go out regardless of the timeout. License: MIT Signed-off-by: Michael Avila <davidmichaelavila@gmail.com>

Michael Avila committed Mar 8, 2019 at 15:49 UTC d786a69e72c6423808c4f6c675194f62a98d91de
1 file changed -5
provider/provider.go
-5
@@ -8,7 +8,6 @@ import (
8 "github.com/ipfs/go-cid"
9 logging "github.com/ipfs/go-log"
10 "github.com/libp2p/go-libp2p-routing"
11 - "time"
11 )
12
13 var (
@@ -17,7 +16,6 @@ var (
16
17 const (
18 provideOutgoingWorkerLimit = 8
20 - provideOutgoingTimeout = 15 * time.Second
19 )
20
21 // Provider announces blocks to the network, tracks which blocks are
@@ -75,14 +73,11 @@ func (p *Provider) handleAnnouncements() {
73 func doProvide(ctx context.Context, contentRouting routing.ContentRouting, key cid.Cid) error {
74 // announce
75 log.Info("announce - start - ", key)
78 - ctx, cancel := context.WithTimeout(ctx, provideOutgoingTimeout)
76 if err := contentRouting.Provide(ctx, key, true); err != nil {
77 log.Warningf("Failed to provide cid: %s", err)
78 // TODO: Maybe put these failures onto a failures queue?
82 - cancel()
79 return err
80 }
85 - cancel()
81 log.Info("announce - end - ", key)
82 return nil
83 }