Skip to content

Commit

Permalink
feat: 支持配置 Redis Stream 名称
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed May 24, 2024
1 parent 5b2747a commit 3deed20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CAMPUX_REDIS_PORT=6379
CAMPUX_REDIS_PASSWORD=""
CAMPUX_REDIS_PUBLISH_POST_STREAM="campux_publish_post"
CAMPUX_REDIS_NEW_POST_STREAM="campux_new_post"
CAMPUX_REDIS_POST_CANCEL_STREAM="campux_post_cancel"
CAMPUX_HELP_MESSAGE="填写未匹配指令时的帮助信息。每用户每60秒只会响应一次。"
CAMPUX_REVIEW_HELP_MESSAGE="填写未匹配指令时的审核帮助信息"
CAMPUX_REVIEW_QQ_GROUP_ID=123456789
Expand Down
7 changes: 7 additions & 0 deletions campux/mq/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ async def initialize(self):
password=self.ap.config.campux_redis_password
)

# 从config取出各个stream的名字
for stream_key in streams_name.keys():
if hasattr(self.ap.config, stream_key):
streams_name[stream_key] = getattr(self.ap.config, stream_key)

logger.info(f"Redis Streams: {streams_name}")

# 创建xgroup
# 检查是否存在同名group

Expand Down

0 comments on commit 3deed20

Please sign in to comment.