Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit b6fab53

Browse files
hoffmabcdrwasho
authored andcommitted
Increase logging and wait for DHT to bootstrap
1 parent f61a146 commit b6fab53

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ipfs/pointers.go

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ func PutPointerToPeer(dht *routing.IpfsDHT, ctx context.Context, peer peer.ID, p
8989

9090
func GetPointersFromPeer(dht *routing.IpfsDHT, ctx context.Context, p peer.ID, key *cid.Cid) ([]*ps.PeerInfo, error) {
9191
pmes := dhtpb.NewMessage(dhtpb.Message_GET_PROVIDERS, key.Bytes(), 0)
92+
log.Debugf("Fetching pointers from: %v\n", p.Pretty())
9293
resp, err := dht.SendRequest(ctx, p, pmes)
9394
if err != nil {
9495
return []*ps.PeerInfo{}, err

net/retriever/retriever.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,15 @@ func (m *MessageRetriever) getPointersFromDataPeersRoutine(peerOut chan ps.PeerI
234234
wg.Add(1)
235235
go func(pid peer.ID) {
236236
defer wg.Done()
237-
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
237+
ctx, cancel := context.WithTimeout(context.Background(), time.Second*35)
238238
defer cancel()
239+
time.Sleep(time.Second*15)
239240
provs, err := ipfs.GetPointersFromPeer(m.routing, ctx, pid, &k)
240241
if err != nil {
242+
log.Errorf("Could not get pointers from push node because: %v", err)
241243
return
242244
}
245+
log.Debugf("Successfully queried %s for pointers", pid.Pretty())
243246
for _, pi := range provs {
244247
peerOut <- *pi
245248
}

0 commit comments

Comments
 (0)