Server: Add launcher version scanning on startup
- Scan versions/ directory and generate meta.json for each version - Log progress: 'Scanning launcher versions...', 'Launcher meta ready: vX (Y files)' - Meta cached in memory for faster access
This commit is contained in:
@@ -148,6 +148,17 @@ async def lifespan(app: FastAPI):
|
|||||||
|
|
||||||
logger.info("All packs ready. Server is running.")
|
logger.info("All packs ready. Server is running.")
|
||||||
|
|
||||||
|
# Scan launcher versions and generate meta
|
||||||
|
logger.info("Scanning launcher versions...")
|
||||||
|
launcher_versions = get_launcher_versions()
|
||||||
|
if launcher_versions:
|
||||||
|
latest = launcher_versions[0]
|
||||||
|
logger.info(f"Launcher meta ready: v{latest['meta']['version']} ({len(latest['meta']['files'])} files)")
|
||||||
|
else:
|
||||||
|
logger.warning("No launcher versions found in new format")
|
||||||
|
|
||||||
|
logger.info("Launcher meta system ready.")
|
||||||
|
|
||||||
# Initialize proxy client
|
# Initialize proxy client
|
||||||
global proxy_client
|
global proxy_client
|
||||||
proxy_client = httpx.AsyncClient(timeout=60.0, follow_redirects=True)
|
proxy_client = httpx.AsyncClient(timeout=60.0, follow_redirects=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user