在scheduler中加了multiproces之后,download 和 md5_list都变成了 multiprocess的 method,无法正常往下执行。
# multiprocess
from pdb import set_trace
set_trace()
scheduler.set_cal_type(CalcType.MultiProcess)
multiprocess_time = scheduler.process()
Traceback (most recent call last):
File "/usr/local/study_process/download_server/scheduler.py", line 119, in <module>
multiprocess_time = scheduler.process()
File "/usr/local/study_process/download_server/scheduler.py", line 51, in process
for md5 in md5_list:
TypeError: 'method' object is not iterable
(Pdb) url_list
['https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png']
(Pdb) content_list
<bound method BaseModule._process_multprocess of <modules.downloader.Downloader object at 0xffffb8dea5b0>>
(Pdb) md5_list
<bound method BaseModule._process_multprocess of <modules.hasher.Hasher object at 0xffffb8dea280>>