Dawnnnnnn / bilibili-live-tools

python实现的bilibili直播助手
MIT License
798 stars 175 forks source link

夜间高峰卡死的分析及解决思路 #265

Open xxKawa opened 4 years ago

xxKawa commented 4 years ago

经过多天本地验证issue259中的https://github.com/Dawnnnnnn/bilibili-live-tools/issues/259评论,发现在夜间礼物高峰期 (常见于晚7点-晚11点) 会出现完全卡死 (log停滞在某个时间,辣条和亲密度不增加) 的问题。 于是从main.py着手修改 实现每20min判断状态重启一次。 将原本的 TIME = 3600 修改为 TIME = 60 能尽可能保证减少丢失亲密值/辣条。

Elu-Thingol commented 4 years ago

TIME = 3600 是20小时重启一次的意思,因为后面 time.sleep(sleep_time * 20)time.sleep 是按秒推迟执行的 3600 × 20 ÷ 60² = 20 。所以如果要20分钟重启一次应该改为 TIME = 60

xxKawa commented 4 years ago

TIME = 3600 是20小时重启一次的意思,因为后面 time.sleep(sleep_time * 20)time.sleep 是按秒推迟执行的 3600 × 20 ÷ 60² = 20 。所以如果要20分钟重启一次应该改为 TIME = 60

确实是我的疏忽 我曾延长过原time.sleep(sleep_time * 20) 的休息时间

ZheJr commented 4 years ago

打包成了EXE怎么搞

------------------ 原始邮件 ------------------ 发件人: "川澄 瀬奈"<notifications@github.com>; 发送时间: 2020年2月25日(星期二) 中午11:49 收件人: "Dawnnnnnn/bilibili-live-tools"<bilibili-live-tools@noreply.github.com>; 抄送: "Subscribed"<subscribed@noreply.github.com>; 主题: Re: [Dawnnnnnn/bilibili-live-tools] 夜间高峰卡死的分析及解决思路 (#265)

TIME = 3600 是20小时重启一次的意思,因为后面 time.sleep(sleep_time * 20) , time.sleep 是按秒推迟执行的 3600 × 20 ÷ 60² = 20 。所以如果要20分钟重启一次应该改为 TIME = 60 。

确实是我的疏忽 我曾延长过原time.sleep(sleep_time * 20) 的休息时间

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

yawwwwwn commented 4 years ago

打包成了EXE怎么搞

.exe 打包的是 run.py。如果还要对 .exe 套 main.py 的壳那就得把 main.py 中   CMD = "run.py"   改成   CMD = "run.exe"   再运行 main.py。

xxKawa commented 4 years ago

275 建议挂云的暂时不要采用这个办法,会导致夜间风险时间领取亲密度。