Improve logging of unicast gossip errors

This commit is contained in:
Bryan Boreham committed 2015-06-25 14:04:37 +01:00
1 parent c58cc449c0
commit b472da18f0
2 files changed
+9 -8

No files matched your search

+4 -2
View File
@@ -44,8 +44,10 @@ func (g *allocate) Try(alloc *Allocator) bool {
// out of space
donors := alloc.ring.ChoosePeersToAskForSpace(g.r.Start, g.r.End)
for _, donor := range donors {
alloc.debugln("Decided to ask peer", donor, "for space in range", g.r)
if err := alloc.sendSpaceRequest(donor, g.r); err == nil {
if err := alloc.sendSpaceRequest(donor, g.r); err != nil {
alloc.debugln("Problem asking peer", donor, "for space:", err)
} else {
alloc.debugln("Decided to ask peer", donor, "for space in range", g.r)
break
}
}