From ecaaa1231a93ca566afa68fc967b47a7c41dfff5 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Wed, 20 Mar 2019 14:25:33 +0100 Subject: [PATCH] fixup --- swarm/network/fetcher.go | 5 ++--- swarm/storage/netstore.go | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/swarm/network/fetcher.go b/swarm/network/fetcher.go index 7fb967f7f3..5c0dfefce5 100644 --- a/swarm/network/fetcher.go +++ b/swarm/network/fetcher.go @@ -30,7 +30,7 @@ import ( ) const ( - defaultSearchTimeout = 4 * time.Second + defaultSearchTimeout = 1 * time.Second // maximum number of forwarded requests (hops), to make sure requests are not // forwarded forever in peer loops maxHopCount uint8 = 20 @@ -38,7 +38,7 @@ const ( // Time to consider peer to be skipped. // Also used in stream delivery. -var RequestTimeout = 15 * time.Second +var RequestTimeout = 10 * time.Second type RequestFunc func(context.Context, *Request) (*enode.ID, chan struct{}, error) @@ -272,7 +272,6 @@ func (f *Fetcher) run(peers *sync.Map) { // * the peer's address is removed from prospective sources, and // * a go routine is started that reports on the gone channel if the peer is disconnected (or terminated their streamer) func (f *Fetcher) doRequest(gone chan *enode.ID, peersToSkip *sync.Map, sources []*enode.ID, hopCount uint8) ([]*enode.ID, error) { - var i int var sourceID *enode.ID var quit chan struct{} diff --git a/swarm/storage/netstore.go b/swarm/storage/netstore.go index 7a2c2d1746..7741b8f7bd 100644 --- a/swarm/storage/netstore.go +++ b/swarm/storage/netstore.go @@ -87,9 +87,9 @@ func (n *NetStore) Put(ctx context.Context, ch Chunk) error { // if chunk is now put in the store, check if there was an active fetcher and call deliver on it // (this delivers the chunk to requestors via the fetcher) - log.Debug("n.getFetcher", "ref", ch.Address()) + log.Trace("n.getFetcher", "ref", ch.Address()) if f := n.getFetcher(ch.Address()); f != nil { - log.Debug("n.getFetcher deliver", "ref", ch.Address()) + log.Trace("n.getFetcher deliver", "ref", ch.Address()) f.deliver(ctx, ch) } return nil @@ -343,6 +343,6 @@ func (f *fetcher) deliver(ctx context.Context, ch Chunk) { f.chunk = ch // closing the deliveredC channel will terminate ongoing requests close(f.deliveredC) - log.Debug("n.getFetcher close deliveredC", "ref", ch.Address()) + log.Trace("n.getFetcher close deliveredC", "ref", ch.Address()) }) }