Update app/main.py
Browse files- app/main.py +4 -3
app/main.py
CHANGED
|
@@ -47,7 +47,7 @@ def log_api_call(db, name: str, status: str, response_time: float, endpoint: str
|
|
| 47 |
|
| 48 |
Args:
|
| 49 |
db: MongoDB database instance
|
| 50 |
-
name: API name (e.g., "smart budget
|
| 51 |
status: "success" or "fail"
|
| 52 |
response_time: Response time in seconds
|
| 53 |
endpoint: Optional endpoint path
|
|
@@ -104,7 +104,7 @@ async def log_requests(request: Request, call_next):
|
|
| 104 |
# Log the API call
|
| 105 |
log_api_call(
|
| 106 |
db=db,
|
| 107 |
-
name="smart budget
|
| 108 |
status=status,
|
| 109 |
response_time=process_time,
|
| 110 |
endpoint=endpoint
|
|
@@ -116,7 +116,7 @@ async def log_requests(request: Request, call_next):
|
|
| 116 |
# Log failure
|
| 117 |
log_api_call(
|
| 118 |
db=db,
|
| 119 |
-
name="smart budget
|
| 120 |
status="fail",
|
| 121 |
response_time=process_time,
|
| 122 |
endpoint=endpoint,
|
|
@@ -218,6 +218,7 @@ if __name__ == "__main__":
|
|
| 218 |
|
| 219 |
|
| 220 |
|
|
|
|
| 221 |
# from fastapi import FastAPI, HTTPException, Depends
|
| 222 |
# from fastapi.middleware.cors import CORSMiddleware
|
| 223 |
# from pymongo import MongoClient
|
|
|
|
| 47 |
|
| 48 |
Args:
|
| 49 |
db: MongoDB database instance
|
| 50 |
+
name: API name (e.g., "smart budget recommendation")
|
| 51 |
status: "success" or "fail"
|
| 52 |
response_time: Response time in seconds
|
| 53 |
endpoint: Optional endpoint path
|
|
|
|
| 104 |
# Log the API call
|
| 105 |
log_api_call(
|
| 106 |
db=db,
|
| 107 |
+
name="smart budget recommendation",
|
| 108 |
status=status,
|
| 109 |
response_time=process_time,
|
| 110 |
endpoint=endpoint
|
|
|
|
| 116 |
# Log failure
|
| 117 |
log_api_call(
|
| 118 |
db=db,
|
| 119 |
+
name="smart budget recommendation",
|
| 120 |
status="fail",
|
| 121 |
response_time=process_time,
|
| 122 |
endpoint=endpoint,
|
|
|
|
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
+
|
| 222 |
# from fastapi import FastAPI, HTTPException, Depends
|
| 223 |
# from fastapi.middleware.cors import CORSMiddleware
|
| 224 |
# from pymongo import MongoClient
|