This commit is contained in:
lenheart
2025-04-05 22:03:40 +08:00
parent 4d65103501
commit eeb773e723
53 changed files with 2348 additions and 505 deletions

View File

@@ -220,6 +220,9 @@ class MysqlPool {
//连接池
PoolList = null;
//是否已经初始化
IsInit = false;
constructor() {
PoolList = [];
getroottable()._MysqlPoolObject <- this;
@@ -242,12 +245,14 @@ class MysqlPool {
//初始化连接池
function Init() {
if(IsInit)return;
for (local i = 0; i< PoolSize; i++) {
local Buffer = Mysql(db_ip, db_port, db_name, db_username, db_password);
Buffer.Exec_Sql(format("SET NAMES %s", Charset));
PoolList.append(Buffer);
// print("创建了一条连接,编号: " + i + ",地址: " + Buffer + ", 指针地址: " + Buffer.C_Object);
}
IsInit = true;
}
function GetConnect() {