This commit is contained in:
2023-10-05 00:20:43 +03:00
parent a04e81695d
commit 0de9270af9
3 changed files with 12 additions and 19 deletions

View File

@@ -6,6 +6,6 @@ async def notify_message(message, chat_id: str):
channel_name = f"chat:{chat_id}"
data = {**message, "kind": "new_message"}
try:
await redis.execute_pubsub("PUBLISH", channel_name, json.dumps(data))
await redis.publish(channel_name, json.dumps(data))
except Exception as e:
print(f"Failed to publish to channel {channel_name}: {e}")