🐛 Fix expired cookies add to cache

梅开二度
This commit is contained in:
洛水居室 2022-12-14 23:22:11 +08:00
parent c7818f34e0
commit 611ad8dd4e
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -42,7 +42,7 @@ class PublicCookiesService:
user_list: List[int] = [] user_list: List[int] = []
cookies_list = await self._repository.get_all_cookies(RegionEnum.HYPERION) # 从数据库获取2 cookies_list = await self._repository.get_all_cookies(RegionEnum.HYPERION) # 从数据库获取2
for cookies in cookies_list: for cookies in cookies_list:
if cookies.status is not None and cookies.status != CookiesStatusEnum.STATUS_SUCCESS: if cookies.status and cookies.status == CookiesStatusEnum.STATUS_SUCCESS:
continue continue
user_list.append(cookies.user_id) user_list.append(cookies.user_id)
add, count = await self._cache.add_public_cookies(user_list, RegionEnum.HYPERION) add, count = await self._cache.add_public_cookies(user_list, RegionEnum.HYPERION)
@ -50,7 +50,7 @@ class PublicCookiesService:
user_list.clear() user_list.clear()
cookies_list = await self._repository.get_all_cookies(RegionEnum.HOYOLAB) cookies_list = await self._repository.get_all_cookies(RegionEnum.HOYOLAB)
for cookies in cookies_list: for cookies in cookies_list:
if cookies.status is not None and cookies.status != CookiesStatusEnum.STATUS_SUCCESS: if cookies.status and cookies.status == CookiesStatusEnum.STATUS_SUCCESS:
user_list.append(cookies.user_id) user_list.append(cookies.user_id)
add, count = await self._cache.add_public_cookies(user_list, RegionEnum.HOYOLAB) add, count = await self._cache.add_public_cookies(user_list, RegionEnum.HOYOLAB)
logger.info(f"国际服公共Cookies池已经添加[{add}]个 当前成员数为[{count}]") logger.info(f"国际服公共Cookies池已经添加[{add}]个 当前成员数为[{count}]")