diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-05-06 16:58:42 +0800 |
---|---|---|
committer | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-05-10 18:26:55 +0800 |
commit | 8802b9ce7fe8f9764bd50dfe072b37ebc9e84cb8 (patch) | |
tree | 1bd8999f1aeda1f4a470bcd45ba466074ffdf42b /cmd/swarm/swarm-smoke/upload_and_sync.go | |
parent | ad6c39012fc761dd02a6b1a7fbfdcf2478abe2a1 (diff) | |
download | go-tangerine-8802b9ce7fe8f9764bd50dfe072b37ebc9e84cb8.tar go-tangerine-8802b9ce7fe8f9764bd50dfe072b37ebc9e84cb8.tar.gz go-tangerine-8802b9ce7fe8f9764bd50dfe072b37ebc9e84cb8.tar.bz2 go-tangerine-8802b9ce7fe8f9764bd50dfe072b37ebc9e84cb8.tar.lz go-tangerine-8802b9ce7fe8f9764bd50dfe072b37ebc9e84cb8.tar.xz go-tangerine-8802b9ce7fe8f9764bd50dfe072b37ebc9e84cb8.tar.zst go-tangerine-8802b9ce7fe8f9764bd50dfe072b37ebc9e84cb8.zip |
swarm-smoke: add syncDelay flag
swarm/network: add want delay timer to syncing (#1367)
swarm/network: synchronise peer.close() (#1369)
Diffstat (limited to 'cmd/swarm/swarm-smoke/upload_and_sync.go')
-rw-r--r-- | cmd/swarm/swarm-smoke/upload_and_sync.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cmd/swarm/swarm-smoke/upload_and_sync.go b/cmd/swarm/swarm-smoke/upload_and_sync.go index d6eb87ace..7338e3473 100644 --- a/cmd/swarm/swarm-smoke/upload_and_sync.go +++ b/cmd/swarm/swarm-smoke/upload_and_sync.go @@ -197,7 +197,8 @@ func getBzzAddrFromHost(client *rpc.Client) (string, error) { // we make an ugly assumption about the output format of the hive.String() method // ideally we should replace this with an API call that returns the bzz addr for a given host, // but this also works for now (provided we don't change the hive.String() method, which we haven't in some time - return strings.Split(strings.Split(hive, "\n")[3], " ")[10], nil + ss := strings.Split(strings.Split(hive, "\n")[3], " ") + return ss[len(ss)-1], nil } // checkChunksVsMostProxHosts is checking: @@ -284,13 +285,16 @@ func uploadAndSync(c *cli.Context, randomBytes []byte) error { log.Info("uploaded successfully", "hash", hash, "took", t2, "digest", fmt.Sprintf("%x", fhash)) - waitToSync() + // wait to sync and log chunks before fetch attempt, only if syncDelay is set to true + if syncDelay { + waitToSync() - log.Debug("chunks before fetch attempt", "hash", hash) + log.Debug("chunks before fetch attempt", "hash", hash) - err = trackChunks(randomBytes, false) - if err != nil { - log.Error(err.Error()) + err = trackChunks(randomBytes, false) + if err != nil { + log.Error(err.Error()) + } } if onlyUpload { |