Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自设cron_hours中 ,最晚时间早于北京22点,导致刷步不足,的解决方案 #12

Open
AC-Dawn opened this issue Mar 1, 2024 · 0 comments

Comments

@AC-Dawn
Copy link

AC-Dawn commented Mar 1, 2024

仅为分享个人特殊情况提供的解决方案,非bug,有相似需要的可以看看。

前提:已按照指引配置,且workflow通。
背景:个人设置cron_hours为2,3;即运行时间为北京时间10点和11点,步数为2w-2w4。12点时发现,仅能刷到1w2。
问题定位:main.py中time_rate,以每天22小时作为分母逐步提高进度。导致当hour=3+8=11时,仅能执行约11/22 = 1/2,也就是步数的一半。
time_rate = min((hour * 60 + minute) / (22 * 60), 1)
解决方案:以设置的最后一次时间来倒推分母。例如我希望11点时走完全天量,那么将22设置成12。如果一天只注入一次10点的,那么22设置成11。同理类推,使得time_rate趋近于1。

最后,感谢开发者❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant