From 42b727e92691f55513b80a95b714b35bad6d086b Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 12 Sep 2024 17:56:54 -0700 Subject: [PATCH] Revert additional logging enabled to debug automation failures in prod Additional logging was enabled to debug automation failures in production since migration chat API to use POST request method (from earlier GET). Redirect from http to https was default to use GET instead of POST method to call /api/chat on redirect. This has been resolved now --- src/khoj/routers/helpers.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/khoj/routers/helpers.py b/src/khoj/routers/helpers.py index 537d92a8..e8c9e9ce 100644 --- a/src/khoj/routers/helpers.py +++ b/src/khoj/routers/helpers.py @@ -1217,11 +1217,6 @@ def scheduled_chat( token = token[0].token headers["Authorization"] = f"Bearer {token}" - # Log request details - logger.info(f"POST URL: {url}") - logger.info(f"Headers: {headers}") - logger.info(f"Payload: {json_payload}") - # Call the chat API endpoint with authenticated user token and query raw_response = requests.post(url, headers=headers, json=json_payload, allow_redirects=False) @@ -1231,14 +1226,6 @@ def scheduled_chat( logger.info(f"Redirecting to {redirect_url}") raw_response = requests.post(redirect_url, headers=headers, json=json_payload) - # Log response details - logger.info(f"Response status code: {raw_response.status_code}") - logger.info(f"Response headers: {raw_response.headers}") - logger.info(f"Response text: {raw_response.text}") - if raw_response.history: - for resp in raw_response.history: - logger.info(f"Redirected from {resp.url} with status code {resp.status_code}") - # Stop if the chat API call was not successful if raw_response.status_code != 200: logger.error(f"Failed to run schedule chat: {raw_response.text}, user: {user}, query: {query_to_run}")