feat(redis): add subscriber for pub/sub mode

This commit is contained in:
MingxuanGame
2025-08-09 12:09:23 +00:00
parent 832a6fc95d
commit 8531e67423
3 changed files with 26 additions and 1 deletions

View File

@@ -38,3 +38,7 @@ async def create_tables():
# Redis 依赖
def get_redis():
return redis_client
def get_redis_pubsub(channel: str | None = None):
return redis_client.pubsub(ignore_subscribe_messages=True, channel=channel)