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
|
host = None
|
||||||
local = None
|
local = None
|
||||||
_online = None
|
_online = None
|
||||||
download_speed = 0
|
|
||||||
TIMEOUT = 5
|
TIMEOUT = 5
|
||||||
|
|
||||||
def __init__(self, nodes, user):
|
def __init__(self, nodes, user):
|
||||||
|
@ -281,7 +280,6 @@ class Node(Thread):
|
||||||
def download(self, item):
|
def download(self, item):
|
||||||
self.resolve()
|
self.resolve()
|
||||||
url = '%s/get/%s' % (self.url, item.id)
|
url = '%s/get/%s' % (self.url, item.id)
|
||||||
t1 = datetime.utcnow()
|
|
||||||
if DEBUG_NODES:
|
if DEBUG_NODES:
|
||||||
logger.debug('download %s', url)
|
logger.debug('download %s', url)
|
||||||
self._opener.addheaders = list(zip(self.headers.keys(), self.headers.values()))
|
self._opener.addheaders = list(zip(self.headers.keys(), self.headers.values()))
|
||||||
|
@ -333,10 +331,6 @@ class Node(Thread):
|
||||||
if state.bandwidth:
|
if state.bandwidth:
|
||||||
while not state.bandwidth.download(chunk_size) and not state.shutdown:
|
while not state.bandwidth.download(chunk_size) and not state.shutdown:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
t2 = datetime.utcnow()
|
|
||||||
duration = (t2-t1).total_seconds()
|
|
||||||
if duration:
|
|
||||||
self.download_speed = size / duration
|
|
||||||
return item.save_file(content)
|
return item.save_file(content)
|
||||||
except:
|
except:
|
||||||
logger.debug('download failed %s', url, exc_info=True)
|
logger.debug('download failed %s', url, exc_info=True)
|
||||||
|
|
Loading…
Reference in a new issue