Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Commit

Permalink
cmd/swarm-smoke: fix waitToPushSynced connection closing (#1781)
Browse files Browse the repository at this point in the history
  • Loading branch information
janos authored and nonsense committed Sep 19, 2019
1 parent d13ef0a commit f185630
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions cmd/swarm-smoke/upload_and_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,24 +333,25 @@ func waitToPushSynced(tagname string) {
for {
time.Sleep(200 * time.Millisecond)

rpcClient, err := rpc.Dial(wsEndpoint(hosts[0]))
if rpcClient != nil {
defer rpcClient.Close()
}
if err != nil {
log.Error("error dialing host", "err", err)
continue
}

bzzClient := client.NewBzz(rpcClient)
if func() (synced bool) {
rpcClient, err := rpc.Dial(wsEndpoint(hosts[0]))
if rpcClient != nil {
defer rpcClient.Close()
}
if err != nil {
log.Error("error dialing host", "err", err)
return false
}

synced, err := bzzClient.IsPushSynced(tagname)
if err != nil {
log.Error(err.Error())
continue
}
bzzClient := client.NewBzz(rpcClient)

if synced {
synced, err = bzzClient.IsPushSynced(tagname)
if err != nil {
log.Error(err.Error())
return false
}
return synced
}() {
return
}
}
Expand Down

0 comments on commit f185630

Please sign in to comment.