1111
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user