Feat: Server refactor v1 (#1509)
Some checks are pending
Pre-commit / pre-commit (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (python) (push) Waiting to run
Test / Run Python Tests (push) Waiting to run

This commit is contained in:
Tong Chen 2026-03-24 18:05:52 +08:00 committed by GitHub
parent 1e542f9d27
commit 712f20a8fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
179 changed files with 5593 additions and 6063 deletions

View file

@ -15,6 +15,7 @@
import logging
import os
import shutil
import threading
import time
from fastapi import APIRouter, HTTPException
@ -779,15 +780,13 @@ async def open_browser_login():
bufsize=1, # Line buffered
)
# Create async task to log Electron output
async def log_electron_output():
def log_electron_output():
for line in iter(process.stdout.readline, ""):
if line:
logger.info(f"[ELECTRON OUTPUT] {line.strip()}")
import asyncio
asyncio.create_task(log_electron_output())
log_thread = threading.Thread(target=log_electron_output, daemon=True)
log_thread.start()
# Wait a bit for Electron to start
import asyncio

View file

@ -73,6 +73,11 @@ def register_routers(app: FastAPI, prefix: str = "") -> None:
},
]
app.include_router(health_controller.router, tags=["Health"])
logger.info(
"Registered Health router at root level for Docker health checks"
)
for config in routers_config:
app.include_router(
config["router"], prefix=prefix, tags=config["tags"]