Skip to content

Commit

Permalink
♻️ 将 default_cd 重命名为 default_cookie_cd
Browse files Browse the repository at this point in the history
  • Loading branch information
suyiiyii committed Oct 28, 2024
1 parent ac794ef commit b60ba56
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nonebot_bison/platform/bilibili/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class BilibiliSite(CookieSite):
schedule_type = "interval"
client_mgr = BilibiliClientManager
require_browser = True
default_cd: int = timedelta(seconds=120)
default_cookie_cd: int = timedelta(seconds=120)


class BililiveSite(Site):
Expand Down
2 changes: 1 addition & 1 deletion nonebot_bison/platform/weibo.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class WeiboSite(CookieSite):
schedule_type = "interval"
schedule_setting = {"seconds": 3}
client_mgr = create_cookie_client_manager(name)
default_cd: int = timedelta(seconds=15)
default_cookie_cd: int = timedelta(seconds=15)

@classmethod
async def _get_current_user_name(cls, cookies: dict) -> str:
Expand Down
4 changes: 2 additions & 2 deletions nonebot_bison/utils/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async def add_user_cookie(cls, content: str, cookie_name: str | None = None) ->
raise ValueError()
cookie = Cookie(site_name=cls._site_name, content=content)
cookie.cookie_name = cookie_name if cookie_name else await cookie_site.get_cookie_name(content)
cookie.cd = cookie_site.default_cd
cookie.cd = cookie_site.default_cookie_cd
cookie_id = await config.add_cookie(cookie)
return await config.get_cookie_by_id(cookie_id)

Expand Down Expand Up @@ -165,7 +165,7 @@ def __str__(self):

class CookieSite(Site):
client_mgr: type[CookieClientManager] = CookieClientManager
default_cd: int = timedelta(seconds=10)
default_cookie_cd: int = timedelta(seconds=10)

@classmethod
async def get_cookie_name(cls, content: str) -> str:
Expand Down

0 comments on commit b60ba56

Please sign in to comment.