Commit a3402679b21e016f01d5410acfd19ccf87935815
replicate progress: don't include disconnected peers in incomplete count
fixes stuck downloading message progress in patchworkMatt McKegg committed on 10/14/2017, 10:28:48 PM
Parent: 65fd88bcd0ed820d86e39b66e316bf759319a4e4
Files changed
plugins/replicate/legacy.js | changed |
plugins/replicate/legacy.js | ||
---|---|---|
@@ -79,19 +79,17 @@ | ||
79 | 79 … | var pendingPeers = {} |
80 | 80 … | var legacyToRecv = {} |
81 | 81 … | |
82 | 82 … | Object.keys(pendingFeedsForPeer).forEach(function (peerId) { |
83 | - if (pendingFeedsForPeer[peerId]) { | |
83 … | + if (pendingFeedsForPeer[peerId] && pendingFeedsForPeer[peerId].size) { | |
84 | 84 … | Object.keys(toSend).forEach(function (feedId) { |
85 | 85 … | if (peerHas[peerId] && peerHas[peerId][feedId]) { |
86 | 86 … | if (peerHas[peerId][feedId] > toSend[feedId]) { |
87 | 87 … | pendingFeeds.add(feedId) |
88 | 88 … | } |
89 | 89 … | } |
90 | 90 … | }) |
91 | - if (pendingFeedsForPeer[peerId].size) { | |
92 | - pendingPeers[peerId] = pendingFeedsForPeer[peerId].size | |
93 | - } | |
91 … | + pendingPeers[peerId] = pendingFeedsForPeer[peerId].size | |
94 | 92 … | } |
95 | 93 … | }) |
96 | 94 … | |
97 | 95 … | for (var k in toSend) { |
@@ -349,5 +347,4 @@ | ||
349 | 347 … | upto: upto, |
350 | 348 … | changes: notify.listen |
351 | 349 … | } |
352 | 350 … | } |
353 | - |
Built with git-ssb-web