Skip to content

Commit 7bb697f

Browse files
committed
need to decode the message
1 parent e93ec9e commit 7bb697f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

backend/message_listener.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ async def callback(message: AbstractIncomingMessage):
9595

9696
if "event_type" in msg and msg["event_type"] == "file_indexed":
9797
logger.info(f"This is an event type file indexed!")
98+
msg = json.loads(message.body.decode("utf-8"))
99+
100+
# Convert string IDs back to PydanticObjectId if needed
101+
file_data = msg.get("file_data", {})
102+
if "id" in file_data and isinstance(file_data["id"], str):
103+
file_data["id"] = PydanticObjectId(file_data["id"])
104+
105+
# Now you can create your FileOut object
106+
# file_out = FileOut(**file_data)
98107
# TODO - process file indexed event here
99108
else:
100109
job_id = msg["job_id"]

0 commit comments

Comments
 (0)