-
Notifications
You must be signed in to change notification settings - Fork 35
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
独立 bilibili-live 的 SchedConf #473
Conversation
✅ Deploy Preview for nonebot-bison ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
a3993f3
to
f5097a7
Compare
nonebot_bison/platform/bilibili.py
Outdated
_client_refresh_time: datetime | ||
cookie_expire_time = timedelta(hours=5) | ||
|
||
bili_http_client = http_client() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方 client 是统一了,但是 _init_session 和 _refresh_client 的逻辑还是分开的,创建出来的 两个 SchedConf 自己维护自己的 refresh_time,判断要不要 refresh,这部分能不能合并到一起
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_client_refresh_time不是类属性吗 应该是共用的吧
(不过似乎也不应该在__init__里给他初值,这样就赋值了两次
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样吧,把 refresh_time, client, _init_session, _refresh_client 都包在一个新的 class 里,只暴露 get 这个方法
64bd6ec
to
67f74f0
Compare
rebase 一下?codecov 应该对了 |
67f74f0
to
c9f171f
Compare
rebase 了 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #473 +/- ##
==========================================
+ Coverage 83.35% 83.47% +0.11%
==========================================
Files 78 78
Lines 3503 3516 +13
==========================================
+ Hits 2920 2935 +15
+ Misses 583 581 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
与B站动态不同,B站直播使用的是另一个api,并且对直播的查询频率应该更高(
api也没有相应限制)