From d8ea0afe409d013685364d6b578b8fa2da68241e Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Mon, 2 Sep 2019 19:15:15 +0530 Subject: [PATCH] downloadthread.py Pylint fixes --- src/network/downloadthread.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/network/downloadthread.py b/src/network/downloadthread.py index 5aaff614..a4b58862 100644 --- a/src/network/downloadthread.py +++ b/src/network/downloadthread.py @@ -1,3 +1,7 @@ +""" +src/network/downloadthread.py +============================= +""" import time import addresses @@ -12,6 +16,7 @@ from objectracker import missingObjects class DownloadThread(StoppableThread): + """Thread-based class for downloading from connections""" minPending = 200 maxRequestChunk = 1000 requestTimeout = 60 @@ -24,6 +29,7 @@ class DownloadThread(StoppableThread): self.lastCleaned = time.time() def cleanPending(self): + """Expire pending downloads eventually""" deadline = time.time() - DownloadThread.requestExpires try: toDelete = [k for k, v in missingObjects.iteritems() if v < deadline]