Skip to content

Commit

Permalink
feat: 每次检查token前从缓存加载最新的
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Jul 28, 2024
1 parent dd6b587 commit 93ee82d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions campux/social/qzone/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ async def token_valid(self, retry=3) -> bool:

for i in range(retry):
try:
# 尝试从缓存加载cookies
self.ap.cache.load()
self.cookies = self.ap.cache.data['qzone_cookies']

today, total = await self.get_visitor_amount()
return True
except Exception as e:
Expand Down

0 comments on commit 93ee82d

Please sign in to comment.