fix
This commit is contained in:
parent
d4e9f197e2
commit
e084f76c5e
@ -169,11 +169,7 @@ class downloadUtils:
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def queueDownClear(cls): cls.QUEUE_DOWN = Queue()
|
||||
|
||||
@classmethod
|
||||
def putDownUrlDirFileType(cls,url,dir,file,type):
|
||||
cls.QUEUE_DOWN.put([url,dir,file,type])
|
||||
def putDownUrlDirFileType(cls,url,dir,file,type): cls.QUEUE_DOWN.put([url,dir,file,type])
|
||||
|
||||
@classmethod
|
||||
def getDownUrlDirFileType(cls):
|
||||
@ -245,10 +241,13 @@ class downloadUtils:
|
||||
logger.debug(f"concurrency= {concurrency}")
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=concurrency) as executor:
|
||||
future_list = list()
|
||||
while not cls.QUEUE_DOWN.empty():
|
||||
result = cls.QUEUE_DOWN.get(False)
|
||||
(file_url,dir,file,file_type) = [result[0],result[1],result[2],result[3]]
|
||||
future_list.append(executor.submit(cls.common_download,
|
||||
while True:
|
||||
result = cls.getDownUrlDirFileType()
|
||||
if result != None:
|
||||
(file_url,dir,file,file_type) = [result[0],result[1],result[2],result[3]]
|
||||
future_list.append(executor.submit(cls.common_download,
|
||||
file_url,dir,file,file_type,
|
||||
timeout=timeout, proxy_type=proxy_type, proxy=proxy))
|
||||
else:
|
||||
break
|
||||
concurrent.futures.wait(future_list, timeout)
|
||||
Loading…
Reference in New Issue
Block a user