From 4ad6401449b5b8011f37e54e00ebfbc27d0efd45 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Wed, 2 Jan 2019 22:25:25 +0100 Subject: [PATCH] Logic error in download reset - fix requesting the same object over and over again, now it continues to iterate through the other objects and only resets the queue after a timeout after the last received object --- src/randomtrackingdict.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/randomtrackingdict.py b/src/randomtrackingdict.py index 431e75d3..c58a0194 100644 --- a/src/randomtrackingdict.py +++ b/src/randomtrackingdict.py @@ -108,8 +108,8 @@ class RandomTrackingDict(object): # pylint: disable=redefined-outer-name with self.lock: # reset if we've requested all - # or if last object received too long time ago - if self.pendingLen == self.len or self.lastObject + self.pendingTimeout > time(): + # and if last object received too long time ago + if self.pendingLen == self.len and self.lastObject + self.pendingTimeout > time(): self.pendingLen = 0 self.setLastObject() available = self.len - self.pendingLen