代码格式调整

This commit is contained in:
aozhiwei 2019-02-14 15:40:45 +08:00
parent 5156f6eb84
commit fad58e9707

View File

@ -348,12 +348,6 @@ namespace f8
} }
} }
AsyncQueryRequest* GetAsyncQueryRequest(long long seqid)
{
auto itr = async_query_hash.find(seqid);
return itr != async_query_hash.end() ? itr->second : nullptr;
}
void AsyncSqlOnOk(long long seqid, DataSet* data_set) void AsyncSqlOnOk(long long seqid, DataSet* data_set)
{ {
AsyncQueryRequest* request = GetAsyncQueryRequest(seqid); AsyncQueryRequest* request = GetAsyncQueryRequest(seqid);
@ -418,15 +412,26 @@ namespace f8
} }
a8::Timer::Instance()->AddDeadLineTimerAndAttach(1000 * 10, a8::Timer::Instance()->AddDeadLineTimerAndAttach(1000 * 10,
a8::XParams() a8::XParams()
.SetSender(this) .SetSender(p->context_id)
.SetParam1(p->context_id), .SetParam1(exec_async_query_msgid),
[] (const a8::XParams& param) [] (const a8::XParams& param)
{ {
MsgQueue::Instance()->PostMsg_r(param.param1,
a8::XParams()
.SetSender(param.sender)
.SetParam1(AQE_CONN_ERROR));
}, },
&p->timer_attacher.timer_list_); &p->timer_attacher.timer_list_);
} }
private:
AsyncQueryRequest* GetAsyncQueryRequest(long long seqid)
{
auto itr = async_query_hash.find(seqid);
return itr != async_query_hash.end() ? itr->second : nullptr;
}
DBThread* GetDBThread(long long hash_code) DBThread* GetDBThread(long long hash_code)
{ {
if (db_thread_pool.empty() || hash_code < 0) { if (db_thread_pool.empty() || hash_code < 0) {
@ -436,10 +441,12 @@ namespace f8
} }
public: public:
unsigned short exec_async_query_msgid = 0;
private:
long long curr_seqid = 0; long long curr_seqid = 0;
std::map<long long, AsyncQueryRequest*> async_query_hash; std::map<long long, AsyncQueryRequest*> async_query_hash;
unsigned short exec_async_query_msgid = 0;
std::vector<DBThread*> db_thread_pool; std::vector<DBThread*> db_thread_pool;
}; };
@ -486,4 +493,5 @@ namespace f8
{ {
impl_->InternalExecAsyncSql(1, conn_info, querystr, args, param, on_ok, on_error, hash_code); impl_->InternalExecAsyncSql(1, conn_info, querystr, args, param, on_ok, on_error, hash_code);
} }
} }