Skip to content

Commit

Permalink
Add lifespan
Browse files Browse the repository at this point in the history
  • Loading branch information
mishraomp committed Sep 8, 2024
1 parent 8900cd9 commit 9211e5c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend-py/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
title=OpenAPIInfo["title"],
version=OpenAPIInfo["version"],
openapi_tags=tags_metadata,
lifespan=lifespan
)
origins: list[str] = [
"http://localhost*",
Expand Down Expand Up @@ -62,4 +63,4 @@ def filter(self, record: logging.LogRecord) -> bool:
async def lifespan(app: FastAPI):
process = psutil.Process()
uptime = time.time() - process.create_time()
print("startup took:", uptime)
print("startup took:", uptime)

0 comments on commit 9211e5c

Please sign in to comment.