remove unused code
This commit is contained in:
parent
fae4458e8b
commit
28bbad1586
1 changed files with 0 additions and 6 deletions
|
@ -37,7 +37,6 @@ class Node(Thread):
|
|||
host = None
|
||||
local = None
|
||||
_online = None
|
||||
download_speed = 0
|
||||
TIMEOUT = 5
|
||||
|
||||
def __init__(self, nodes, user):
|
||||
|
@ -281,7 +280,6 @@ class Node(Thread):
|
|||
def download(self, item):
|
||||
self.resolve()
|
||||
url = '%s/get/%s' % (self.url, item.id)
|
||||
t1 = datetime.utcnow()
|
||||
if DEBUG_NODES:
|
||||
logger.debug('download %s', url)
|
||||
self._opener.addheaders = list(zip(self.headers.keys(), self.headers.values()))
|
||||
|
@ -333,10 +331,6 @@ class Node(Thread):
|
|||
if state.bandwidth:
|
||||
while not state.bandwidth.download(chunk_size) and not state.shutdown:
|
||||
time.sleep(0.1)
|
||||
t2 = datetime.utcnow()
|
||||
duration = (t2-t1).total_seconds()
|
||||
if duration:
|
||||
self.download_speed = size / duration
|
||||
return item.save_file(content)
|
||||
except:
|
||||
logger.debug('download failed %s', url, exc_info=True)
|
||||
|
|
Loading…
Reference in a new issue