Skip to content

Commit 5a7075f

Browse files
print version to log on startup, track shutdown, v0.5.2
1 parent 4a13fd4 commit 5a7075f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/main.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,24 @@
1111
from app.solver.data.Result import Result
1212
from app.solver.solver import distribute
1313

14-
version = "v0.5.1"
14+
version = "v0.5.2"
1515

1616
app = FastAPI(
1717
title="CutSolverBackend",
1818
version=version
1919
)
2020

2121

22+
@app.on_event("startup")
23+
async def on_startup():
24+
print(f"Starting CutSolver v{version}...")
25+
26+
27+
@app.on_event("shutdown")
28+
async def on_shutdown():
29+
print(f"Shutting down CutSolver...")
30+
31+
2232
# needs to be before CORS!
2333
# https://github.com/tiangolo/fastapi/issues/775#issuecomment-592946834
2434
async def catch_exceptions_middleware(request: Request, call_next):

0 commit comments

Comments
 (0)