Update controllers/ws_controller.py
Browse files
controllers/ws_controller.py
CHANGED
|
@@ -28,6 +28,7 @@ async def get_messages(code: str,websocket:WebSocket,brand_name: Optional[str] =
|
|
| 28 |
# gmail_response = requests.get(gmail_url, headers={"Authorization": f"Bearer {access_token}"})
|
| 29 |
# gmail_data = gmail_response.json()
|
| 30 |
# messages.append(gmail_data['messages'])
|
|
|
|
| 31 |
def fetch_message_wrapper(message_data):
|
| 32 |
message_id = message_data.get("id")
|
| 33 |
if message_id:
|
|
@@ -215,8 +216,9 @@ def extract_text(html_content: str) -> str:
|
|
| 215 |
async def websocket_main(code: str, websocket: WebSocket,brand_name: Optional[str] = None):
|
| 216 |
access_token = code
|
| 217 |
# messages = get_messages(access_token,websocket,brand_name)
|
|
|
|
| 218 |
await get_messages(access_token,websocket,brand_name)
|
| 219 |
-
|
| 220 |
# print(messages)
|
| 221 |
# # logging.info(f"brand_name:{brand_name}")
|
| 222 |
# await websocket.send_json({"total_messages": len(messages)})
|
|
|
|
| 28 |
# gmail_response = requests.get(gmail_url, headers={"Authorization": f"Bearer {access_token}"})
|
| 29 |
# gmail_data = gmail_response.json()
|
| 30 |
# messages.append(gmail_data['messages'])
|
| 31 |
+
print("Inside get messages")
|
| 32 |
def fetch_message_wrapper(message_data):
|
| 33 |
message_id = message_data.get("id")
|
| 34 |
if message_id:
|
|
|
|
| 216 |
async def websocket_main(code: str, websocket: WebSocket,brand_name: Optional[str] = None):
|
| 217 |
access_token = code
|
| 218 |
# messages = get_messages(access_token,websocket,brand_name)
|
| 219 |
+
print("websocket_main")
|
| 220 |
await get_messages(access_token,websocket,brand_name)
|
| 221 |
+
|
| 222 |
# print(messages)
|
| 223 |
# # logging.info(f"brand_name:{brand_name}")
|
| 224 |
# await websocket.send_json({"total_messages": len(messages)})
|