Skip to content

Commit 702d3e1

Browse files
author
glin1993@outlook.com
committed
Fix(Redis): Convert None task_id to empty string during serialization
Resolves DataError in Redis Streams when task_id is None by ensuring it's serialized as an empty string instead of None, which Redis does not support. Applies to ScheduleMessageItem.to_dict method.
1 parent b6ebee6 commit 702d3e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/memos/mem_scheduler/schemas/message_schemas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def to_dict(self) -> dict:
8484
"content": self.content,
8585
"timestamp": self.timestamp.isoformat(),
8686
"user_name": self.user_name,
87-
"task_id": self.task_id,
87+
"task_id": self.task_id if self.task_id is not None else "",
8888
}
8989

9090
@classmethod

0 commit comments

Comments
 (0)