fix: move lifespan definition before app instantiation
All checks were successful
Deploy / deploy (push) Successful in 4s
All checks were successful
Deploy / deploy (push) Successful in 4s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f6e8ecae72
commit
8736985e72
@ -18,12 +18,8 @@ from .docker_monitor import DockerMonitor
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
app = FastAPI(title="RedUnits Control Panel", lifespan=lifespan)
|
|
||||||
|
|
||||||
# Setup paths
|
# Setup paths
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
app.mount("/static", StaticFiles(directory=str(BASE_DIR / "static")), name="static")
|
|
||||||
templates = Jinja2Templates(directory=str(BASE_DIR / "templates"))
|
|
||||||
|
|
||||||
# Initialize Docker monitor
|
# Initialize Docker monitor
|
||||||
docker_monitor = DockerMonitor()
|
docker_monitor = DockerMonitor()
|
||||||
@ -165,6 +161,10 @@ async def lifespan(app: FastAPI):
|
|||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
||||||
|
app = FastAPI(title="RedUnits Control Panel", lifespan=lifespan)
|
||||||
|
app.mount("/static", StaticFiles(directory=str(BASE_DIR / "static")), name="static")
|
||||||
|
templates = Jinja2Templates(directory=str(BASE_DIR / "templates"))
|
||||||
|
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
# HTTP routes
|
# HTTP routes
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user