Fix repeated downloads
- a bug in RandomTrackingDict caused requesting to download the same objects over and over - the bug is that the lastObject wasn't properly initalised, this caused the write buffer to fill with "getdata" requests until the first object was received - this PR should address both the excessive bandwidth as well as excessive CPU usage during downloading
This commit is contained in:
parent
7895e94365
commit
c3939875d3
|
@ -111,6 +111,7 @@ class RandomTrackingDict(object):
|
||||||
# or if last object received too long time ago
|
# or if last object received too long time ago
|
||||||
if self.pendingLen == self.len or self.lastObject + self.pendingTimeout > time():
|
if self.pendingLen == self.len or self.lastObject + self.pendingTimeout > time():
|
||||||
self.pendingLen = 0
|
self.pendingLen = 0
|
||||||
|
self.setLastObject()
|
||||||
available = self.len - self.pendingLen
|
available = self.len - self.pendingLen
|
||||||
if count > available:
|
if count > available:
|
||||||
count = available
|
count = available
|
||||||
|
|
Loading…
Reference in New Issue
Block a user