Skip to content

Commit

Permalink
fix: 修复判断
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoaer committed Nov 30, 2023
1 parent e040ab2 commit bbde9d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

client = httpx.AsyncClient(headers=HEADERS)

anchor = datetime.datetime.today()
anchor = datetime.date.today()


async def cleanup() -> None:
Expand Down Expand Up @@ -95,10 +95,10 @@ async def manage_model(medias: list[dict], fav_list: FavoriteList) -> None:

async def process() -> None:
global anchor
if datetime.datetime.now() > anchor and await credential.check_refresh():
if datetime.date.today() >= anchor and await credential.check_refresh():
try:
await credential.refresh()
anchor = datetime.datetime.today() + datetime.timedelta(days=1)
anchor = datetime.date.today() + datetime.timedelta(days=1)
logger.info("Credential refreshed.")
except Exception:
logger.exception("Failed to refresh credential.")
Expand Down

0 comments on commit bbde9d6

Please sign in to comment.