Download optimisation

- pending download tracking now per-connection instead of globally
This commit is contained in:
Peter Šurda 2017-11-17 19:49:51 +01:00
parent 5a787f41d2
commit 1e02d2b48a
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -48,7 +48,7 @@ class DownloadThread(threading.Thread, StoppableThread):
# this may take a while, but it needs a consistency so I think it's better to lock a bigger chunk # this may take a while, but it needs a consistency so I think it's better to lock a bigger chunk
with i.objectsNewToMeLock: with i.objectsNewToMeLock:
try: try:
downloadPending = len(list((k for k, v in i.objectsNewToMe.iteritems() if k in missingObjects and missingObjects[k] > timedOut))) downloadPending = len(list((k for k, v in i.objectsNewToMe.iteritems() if k in missingObjects and missingObjects[k] > timedOut and not v)))
except KeyError: except KeyError:
continue continue
if downloadPending >= DownloadThread.minPending: if downloadPending >= DownloadThread.minPending: