From 59b94bced148058991f6393d1a7d82cce948e511 Mon Sep 17 00:00:00 2001 From: azw Date: Thu, 13 Apr 2023 22:24:02 +0000 Subject: [PATCH] 1 --- server/wsproxy/mastermgr.cc | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/server/wsproxy/mastermgr.cc b/server/wsproxy/mastermgr.cc index abcffb4..f7ab86b 100644 --- a/server/wsproxy/mastermgr.cc +++ b/server/wsproxy/mastermgr.cc @@ -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 } }