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.")