downloadthread.py flake8 fixes
This commit is contained in:
parent
b927d51eb3
commit
8589f01d3d
|
@ -38,10 +38,13 @@ class DownloadThread(StoppableThread):
|
||||||
while not self._stopped:
|
while not self._stopped:
|
||||||
requested = 0
|
requested = 0
|
||||||
# Choose downloading peers randomly
|
# Choose downloading peers randomly
|
||||||
connections = [x for x in BMConnectionPool().inboundConnections.values() + BMConnectionPool().outboundConnections.values() if x.fullyEstablished]
|
connections = [
|
||||||
|
x for x in
|
||||||
|
BMConnectionPool().inboundConnections.values() + BMConnectionPool().outboundConnections.values()
|
||||||
|
if x.fullyEstablished]
|
||||||
helper_random.randomshuffle(connections)
|
helper_random.randomshuffle(connections)
|
||||||
try:
|
try:
|
||||||
requestChunk = max(int(min(DownloadThread.maxRequestChunk, len(missingObjects)) / len(connections)), 1)
|
requestChunk = max(int(min(DownloadThread.maxRequestChunk, len(missingObjects)) / len(connections)), 1)
|
||||||
except ZeroDivisionError:
|
except ZeroDivisionError:
|
||||||
requestChunk = 1
|
requestChunk = 1
|
||||||
for i in connections:
|
for i in connections:
|
||||||
|
|
Reference in New Issue
Block a user