fix: Matrix连接改为非阻塞模式,修复服务启动阻塞问题
This commit is contained in:
25
reset_config.py
Normal file
25
reset_config.py
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
"""重置配置 - 使用mock模式"""
|
||||
import sys
|
||||
sys.path.insert(0, '/home/xian/.openclaw/workspace-coder/works/ai-chat')
|
||||
|
||||
from models import SessionLocal, SystemConfig, init_db
|
||||
|
||||
init_db()
|
||||
db = SessionLocal()
|
||||
|
||||
# 删除所有AI配置(让服务使用mock模式)
|
||||
keys_to_delete = ['ai_api_base', 'ai_api_key', 'ai_model']
|
||||
for key in keys_to_delete:
|
||||
c = db.query(SystemConfig).filter(SystemConfig.key == key).first()
|
||||
if c:
|
||||
db.delete(c)
|
||||
|
||||
# 保留Matrix配置
|
||||
print("当前配置:")
|
||||
for c in db.query(SystemConfig).all():
|
||||
print(f" {c.key}: {c.value[:20]}...")
|
||||
|
||||
db.commit()
|
||||
print("\nAI将使用mock模式(因为没有配置AI API)")
|
||||
db.close()
|
||||
Reference in New Issue
Block a user