1
This commit is contained in:
parent
1417be83e0
commit
c142794c12
@ -141,7 +141,6 @@ namespace f8
|
|||||||
}
|
}
|
||||||
last_checkdb_tick_ = a8::XGetTickCount();
|
last_checkdb_tick_ = a8::XGetTickCount();
|
||||||
if (last_conn_ && last_query_) {
|
if (last_conn_ && last_query_) {
|
||||||
#if 0
|
|
||||||
if (last_query_->ExecQuery("SELECT 1;", {}) <= 0) {
|
if (last_query_->ExecQuery("SELECT 1;", {}) <= 0) {
|
||||||
#if 0
|
#if 0
|
||||||
a8::UdpLog::Instance()->Warning("mysql disconnect", {});
|
a8::UdpLog::Instance()->Warning("mysql disconnect", {});
|
||||||
@ -153,7 +152,6 @@ namespace f8
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,9 +201,7 @@ namespace f8
|
|||||||
}
|
}
|
||||||
printf("CreateConn\n");
|
printf("CreateConn\n");
|
||||||
last_conn_ = new a8::mysql::Connection();
|
last_conn_ = new a8::mysql::Connection();
|
||||||
#if 0
|
|
||||||
last_query_ = last_conn_->CreateQuery();
|
last_query_ = last_conn_->CreateQuery();
|
||||||
#endif
|
|
||||||
if (last_conn_->Connect(
|
if (last_conn_->Connect(
|
||||||
conn_info.Get("host"),
|
conn_info.Get("host"),
|
||||||
conn_info.Get("port"),
|
conn_info.Get("port"),
|
||||||
@ -213,9 +209,7 @@ namespace f8
|
|||||||
conn_info.Get("passwd"),
|
conn_info.Get("passwd"),
|
||||||
conn_info.Get("database")
|
conn_info.Get("database")
|
||||||
)) {
|
)) {
|
||||||
#if 0
|
|
||||||
f8::InitMysqlConnection(last_query_);
|
f8::InitMysqlConnection(last_query_);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -241,7 +235,6 @@ namespace f8
|
|||||||
if (NeedReCreateConn(node->conn_info)) {
|
if (NeedReCreateConn(node->conn_info)) {
|
||||||
ReCreateConn(node->conn_info);
|
ReCreateConn(node->conn_info);
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
switch (node->query_type) {
|
switch (node->query_type) {
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
@ -301,7 +294,6 @@ namespace f8
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -329,12 +321,6 @@ namespace f8
|
|||||||
|
|
||||||
void Init()
|
void Init()
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
/*mysql_init()不是完全线程安全的,但是只要成功调用一次就后就线程安全了,
|
|
||||||
如果有多线程并发使用mysql_init(),建议在程序初始化时空调一次mysql_init(),他的这点特性很像qsort()
|
|
||||||
*/
|
|
||||||
a8::mysql::Connection conn;
|
|
||||||
#endif
|
|
||||||
curr_seqid = 1000001;
|
curr_seqid = 1000001;
|
||||||
exec_async_query_msgid = MsgQueue::Instance()->AllocIMMsgId();
|
exec_async_query_msgid = MsgQueue::Instance()->AllocIMMsgId();
|
||||||
}
|
}
|
||||||
|
17
test/app.cc
17
test/app.cc
@ -88,14 +88,6 @@ void App::Init(int argc, char* argv[])
|
|||||||
InitLog();
|
InitLog();
|
||||||
a8::Timer::Instance()->Init();
|
a8::Timer::Instance()->Init();
|
||||||
f8::MsgQueue::Instance()->Init();
|
f8::MsgQueue::Instance()->Init();
|
||||||
#if 0
|
|
||||||
#if 1
|
|
||||||
auto ret = mysql_library_init(0, nullptr, nullptr);
|
|
||||||
assert(ret == 0);
|
|
||||||
#endif
|
|
||||||
mysql_thread_init();
|
|
||||||
mysql_init_conn = mysql_init(nullptr);
|
|
||||||
#endif
|
|
||||||
f8::DBPool::Instance()->Init();
|
f8::DBPool::Instance()->Init();
|
||||||
f8::DBPool::Instance()->SetThreadNum(10);
|
f8::DBPool::Instance()->SetThreadNum(10);
|
||||||
|
|
||||||
@ -132,15 +124,6 @@ void App::UnInit()
|
|||||||
f8::MsgQueue::Instance()->UnInit();
|
f8::MsgQueue::Instance()->UnInit();
|
||||||
a8::Timer::Instance()->UnInit();
|
a8::Timer::Instance()->UnInit();
|
||||||
UnInitLog();
|
UnInitLog();
|
||||||
|
|
||||||
#if 0
|
|
||||||
mysql_close(mysql_init_conn);
|
|
||||||
mysql_thread_end();
|
|
||||||
#if 0
|
|
||||||
mysql_library_end();
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
delete im_msg_mutex_;
|
delete im_msg_mutex_;
|
||||||
im_msg_mutex_ = nullptr;
|
im_msg_mutex_ = nullptr;
|
||||||
delete loop_cond_;
|
delete loop_cond_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user