INNER CODE UNIT · Python
_startup_update_check
slive777/OpenAver · web/app.py:79
async def _startup_update_check() -> None:
"""啟動時背景檢查新版;任何錯誤只記錄,不阻斷啟動。"""
try:
_cfg = load_config() # raw dict
if not _cfg.get("general", {}).get("auto_check_update", True):
return
result = await check_update() # 復用端點函式,check_update() 本體不動
_maybe_notify_update(result)
except Exception:
logger.warning("lifespan: startup update check failed", exc_info=True)
async def _periodic_update_check_loop() -> None:
"""非桌面版每 24 小時重查一次;啟動當下已由 startup task 查過。"""
if _is_windows_desktop() or _is_mac_desktop():
return
while True:
await asyncio.sleep(86400)