feat: add cold debugging
Browse files
app.py
CHANGED
@@ -67,9 +67,9 @@ def generate_trip_plan(request: PlanRequest):
|
|
67 |
"attempt": attempt + 1
|
68 |
}
|
69 |
)
|
70 |
-
except
|
71 |
-
logger.warning(f"
|
72 |
-
|
73 |
# If this was the last attempt, raise the error
|
74 |
if attempt == MAX_RETRIES - 1:
|
75 |
logger.error(f"All {MAX_RETRIES} attempts failed due to timeout")
|
@@ -86,18 +86,18 @@ def generate_trip_plan(request: PlanRequest):
|
|
86 |
logger.info(f"Retrying in {RETRY_DELAY} seconds...")
|
87 |
time.sleep(RETRY_DELAY)
|
88 |
|
89 |
-
except Exception as e:
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
|
102 |
|
103 |
@app.post("/v1/addYoutubeLink", response_model=YoutubeLinkResponse)
|
|
|
67 |
"attempt": attempt + 1
|
68 |
}
|
69 |
)
|
70 |
+
except Exception as e:
|
71 |
+
logger.warning(f"Error on attempt {attempt + 1}: {e}")
|
72 |
+
|
73 |
# If this was the last attempt, raise the error
|
74 |
if attempt == MAX_RETRIES - 1:
|
75 |
logger.error(f"All {MAX_RETRIES} attempts failed due to timeout")
|
|
|
86 |
logger.info(f"Retrying in {RETRY_DELAY} seconds...")
|
87 |
time.sleep(RETRY_DELAY)
|
88 |
|
89 |
+
# except Exception as e:
|
90 |
+
# # For non-timeout errors, don't retry
|
91 |
+
# logger.error(f"Non-timeout error in generate_trip_plan: {e}")
|
92 |
+
# raise HTTPException(
|
93 |
+
# status_code=500,
|
94 |
+
# detail={
|
95 |
+
# "error": "Internal server error",
|
96 |
+
# "message": "Failed to generate trip plan",
|
97 |
+
# "details": str(e),
|
98 |
+
# "attempt": attempt + 1
|
99 |
+
# }
|
100 |
+
# )
|
101 |
|
102 |
|
103 |
@app.post("/v1/addYoutubeLink", response_model=YoutubeLinkResponse)
|