downloadthread.py Pylint fixes
This commit is contained in:
parent
8589f01d3d
commit
d8ea0afe40
|
@ -1,3 +1,7 @@
|
||||||
|
"""
|
||||||
|
src/network/downloadthread.py
|
||||||
|
=============================
|
||||||
|
"""
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import addresses
|
import addresses
|
||||||
|
@ -12,6 +16,7 @@ from objectracker import missingObjects
|
||||||
|
|
||||||
|
|
||||||
class DownloadThread(StoppableThread):
|
class DownloadThread(StoppableThread):
|
||||||
|
"""Thread-based class for downloading from connections"""
|
||||||
minPending = 200
|
minPending = 200
|
||||||
maxRequestChunk = 1000
|
maxRequestChunk = 1000
|
||||||
requestTimeout = 60
|
requestTimeout = 60
|
||||||
|
@ -24,6 +29,7 @@ class DownloadThread(StoppableThread):
|
||||||
self.lastCleaned = time.time()
|
self.lastCleaned = time.time()
|
||||||
|
|
||||||
def cleanPending(self):
|
def cleanPending(self):
|
||||||
|
"""Expire pending downloads eventually"""
|
||||||
deadline = time.time() - DownloadThread.requestExpires
|
deadline = time.time() - DownloadThread.requestExpires
|
||||||
try:
|
try:
|
||||||
toDelete = [k for k, v in missingObjects.iteritems() if v < deadline]
|
toDelete = [k for k, v in missingObjects.iteritems() if v < deadline]
|
||||||
|
|
Reference in New Issue
Block a user