From 1e02d2b48a5e135f0eb8567c4b374b6c84205a97 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Fri, 17 Nov 2017 19:49:51 +0100 Subject: [PATCH] Download optimisation - pending download tracking now per-connection instead of globally --- src/network/downloadthread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/downloadthread.py b/src/network/downloadthread.py index 414aacd2..8c384edc 100644 --- a/src/network/downloadthread.py +++ b/src/network/downloadthread.py @@ -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 with i.objectsNewToMeLock: 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: continue if downloadPending >= DownloadThread.minPending: