chore: sync current WechatHookBot workspace
This commit is contained in:
@@ -190,11 +190,14 @@ class ContextStore:
|
||||
if self._use_redis_for_group_history():
|
||||
redis_cache = get_cache()
|
||||
try:
|
||||
key = f"group_history:{_safe_chat_id(chat_id)}"
|
||||
# 使用与写入时相同的 key 格式: "group_history:{chat_id}"
|
||||
# 注意:redis_cache._make_key 会生成 "group_history:{chat_id}" 格式
|
||||
# 这里直接使用原始 chat_id,与 add_group_message 保持一致
|
||||
key = f"group_history:{chat_id}"
|
||||
redis_cache.delete(key)
|
||||
logger.debug(f"[ContextStore] 已清除 Redis 群聊历史: {chat_id}")
|
||||
logger.info(f"[ContextStore] 已清除 Redis 群聊历史: {key}")
|
||||
except Exception as e:
|
||||
logger.debug(f"[ContextStore] 清除 Redis 群聊历史失败: {e}")
|
||||
logger.warning(f"[ContextStore] 清除 Redis 群聊历史失败: {e}")
|
||||
|
||||
# 清除本地文件中的群聊历史
|
||||
history_file = self._get_history_file(chat_id)
|
||||
|
||||
Reference in New Issue
Block a user