refactor(harness): freeze single-agent contracts
This commit is contained in:
+13
-6
@@ -22,13 +22,20 @@ except ImportError:
|
||||
print("缺少依赖,请先执行: pip install pymysql")
|
||||
sys.exit(1)
|
||||
|
||||
# 从 application.yml 读取的连接信息
|
||||
def required_env(name: str) -> str:
|
||||
value = os.getenv(name)
|
||||
if value is None or not value.strip():
|
||||
print(f"缺少必需环境变量: {name}")
|
||||
sys.exit(2)
|
||||
return value.strip()
|
||||
|
||||
|
||||
DB_CONFIG = {
|
||||
"host": "119.29.78.52",
|
||||
"port": 33306,
|
||||
"user": "root",
|
||||
"password": "!Fucker123..",
|
||||
"database": "superbiz_agent",
|
||||
"host": os.getenv("SUPERBIZ_MYSQL_HOST", "119.29.78.52"),
|
||||
"port": int(os.getenv("SUPERBIZ_MYSQL_PORT", "33306")),
|
||||
"user": os.getenv("SUPERBIZ_MYSQL_USERNAME", "root"),
|
||||
"password": required_env("SUPERBIZ_MYSQL_PASSWORD"),
|
||||
"database": os.getenv("SUPERBIZ_MYSQL_DATABASE", "superbiz_agent"),
|
||||
"charset": "utf8mb4",
|
||||
"cursorclass": pymysql.cursors.DictCursor,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user