downloadthread.py Pylint fixes

This commit is contained in:
lakshyacis 2019-09-02 19:15:15 +05:30
parent 8589f01d3d
commit d8ea0afe40
No known key found for this signature in database
GPG Key ID: D2C539C8EC63E9EB

View File

@ -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]