feat: implement dashboard download caching and fallback mechanism
- Add local file caching for dashboard downloads with version validation - Implement fallback to 'latest' version if specific version download fails - Add robust error handling in CLI check_dashboard to prevent crashes - Remove dashboard caching from smoke tests (backend-only mode)
This commit is contained in:
@@ -45,13 +45,16 @@ async def check_dashboard(astrbot_root: Path) -> None:
|
||||
abort=True,
|
||||
):
|
||||
click.echo("Installing dashboard...")
|
||||
await download_dashboard(
|
||||
path="data/dashboard.zip",
|
||||
extract_path=str(astrbot_root / "data"),
|
||||
version=f"v{VERSION}",
|
||||
latest=False,
|
||||
)
|
||||
click.echo("Dashboard installed successfully")
|
||||
try:
|
||||
await download_dashboard(
|
||||
path="data/dashboard.zip",
|
||||
extract_path=str(astrbot_root / "data"),
|
||||
version=f"v{VERSION}",
|
||||
latest=False,
|
||||
)
|
||||
click.echo("Dashboard installed successfully")
|
||||
except Exception as e:
|
||||
click.echo(f"Failed to install dashboard: {e}")
|
||||
|
||||
case str():
|
||||
if VersionComparator.compare_version(VERSION, dashboard_version) <= 0:
|
||||
|
||||
Reference in New Issue
Block a user