Skip to content

Commit

Permalink
fix: 每天应仅检查一次 credential
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoaer committed Dec 3, 2023
1 parent 96ff843 commit 650498d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ async def manage_model(medias: list[dict], fav_list: FavoriteList) -> None:

async def process() -> None:
global anchor
if (
today := datetime.date.today()
) > anchor and await credential.check_refresh():
try:
await credential.refresh()
anchor = today
logger.info("Credential refreshed.")
except Exception:
logger.exception("Failed to refresh credential.")
return
if (today := datetime.date.today()) > anchor:
anchor = today
logger.info("Check credential.")
if await credential.check_refresh():
try:
await credential.refresh()
logger.info("Credential refreshed.")
except Exception:
logger.exception("Failed to refresh credential.")
return
for favorite_id in settings.favorite_ids:
if favorite_id not in settings.path_mapper:
logger.warning(
Expand Down

0 comments on commit 650498d

Please sign in to comment.