From bbde9d6ba66e53cae44fe9afde86e7133dea9223 Mon Sep 17 00:00:00 2001 From: amtoaer Date: Thu, 30 Nov 2023 18:12:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- processor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/processor.py b/processor.py index bcbc2c5..14a813d 100644 --- a/processor.py +++ b/processor.py @@ -19,7 +19,7 @@ client = httpx.AsyncClient(headers=HEADERS) -anchor = datetime.datetime.today() +anchor = datetime.date.today() async def cleanup() -> None: @@ -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.")