mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-07-12 16:11:32 +08:00
fix: 每天应仅检查一次 credential
This commit is contained in:
20
processor.py
20
processor.py
@@ -81,16 +81,16 @@ async def manage_model(medias: list[dict], fav_list: FavoriteList) -> None:
|
|||||||
|
|
||||||
async def process() -> None:
|
async def process() -> None:
|
||||||
global anchor
|
global anchor
|
||||||
if (
|
if (today := datetime.date.today()) > anchor:
|
||||||
today := datetime.date.today()
|
anchor = today
|
||||||
) > anchor and await credential.check_refresh():
|
logger.info("Check credential.")
|
||||||
try:
|
if await credential.check_refresh():
|
||||||
await credential.refresh()
|
try:
|
||||||
anchor = today
|
await credential.refresh()
|
||||||
logger.info("Credential refreshed.")
|
logger.info("Credential refreshed.")
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception("Failed to refresh credential.")
|
logger.exception("Failed to refresh credential.")
|
||||||
return
|
return
|
||||||
for favorite_id in settings.favorite_ids:
|
for favorite_id in settings.favorite_ids:
|
||||||
if favorite_id not in settings.path_mapper:
|
if favorite_id not in settings.path_mapper:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
|
|||||||
Reference in New Issue
Block a user