This commit is contained in:
azw 2023-04-13 22:24:02 +00:00
parent 00606e0349
commit 59b94bced1

View File

@ -124,37 +124,25 @@ void MasterMgr::RequestTargetServer(f8::MsgHdr& hdr,
pending_socket_hash_[hdr.socket_handle] = curr_context_id_;
assert(pending_request_hash_.find(curr_context_id_) == pending_request_hash_.end());
pending_request_hash_[curr_context_id_] = req;
#if 1
req->timer_wp = f8::Timer::Instance()->SetTimeoutWp
(1000 * 10,
[req] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
MasterMgr::Instance()->RemoveRequest
(
req->hdr_copy->socket_handle,
req->context_id,
true
);
long long req_handle_time = a8::XGetTickCount() - req->req_tick;
if (req_handle_time > App::Instance()->perf.max_login_time) {
App::Instance()->perf.max_login_time = req_handle_time;
}
DownStreamMgr::Instance()->AddPendingAccount(req->account_id, req->hdr_copy->socket_handle, req->req_tick);
}
}
);
#else
auto timer_func =
[] (const a8::XParams& param)
{
a8::Timer::Instance()->RemoveTimerAfterFunc(a8::Timer::Instance()->GetRunningTimer());
MasterMgr::Instance()->RemoveRequest(
param.param1,
param.sender,
true
);
};
auto timer_after_func =
[] (const a8::XParams& param)
{
long long req_handle_time = a8::XGetTickCount() - param.param3.GetInt64();
if (req_handle_time > App::Instance()->perf.max_login_time) {
App::Instance()->perf.max_login_time = req_handle_time;
}
DownStreamMgr::Instance()->AddPendingAccount(param.param2.GetString(), param.param1, param.param3);
};
#endif
}
}