liuyunfz / chaoxing_tool

超星网课助手,拥有 一键完成超星中的任务点/刷取课程学习次数/下载课程资源 等功能。基于python语言
GNU General Public License v3.0
315 stars 58 forks source link

怎么单线程一个视频一个视频去看 #65

Closed 2682856025 closed 2 years ago

2682856025 commented 2 years ago

想用dev分支 但是还是多线程 怎么改成单线程

SongZihui-sudo commented 2 years ago

在这个自定义任务类里添加任务

------------------ 原始邮件 ------------------ 发件人: "liuyunfz/chaoxing_tool" @.>; 发送时间: 2022年10月14日(星期五) 晚上6:28 @.>; @.***>; 主题: [liuyunfz/chaoxing_tool] 怎么单线程一个视频一个视频去看 (Issue #65)

想用dev分支 但是还是多线程 怎么改成单线程

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

19819068211 commented 2 years ago

请问如何修改可以由多线程同的进行改为一个线程一个线程的运行

liuyunfz commented 2 years ago

您好,多线程的调起在源代码的921行

for i in threadPool:
    i.start()
    time.sleep(10)
for j in threadPool:
    j.join()

所以理论修改为

for i in threadPool:
    i.start()
    i.join()

实现在前一个线程执行完成后再启动下一个线程

19819068211 commented 2 years ago

同理,第785行 for item in video_nomal_thread_pool: 可能也应该注释掉,测试过可以了