Skip to content

Commit

Permalink
Merge branch 'main' into user_reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos authored Jul 19, 2024
2 parents 76c1ee6 + d026688 commit 8ff1f3b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
3 changes: 1 addition & 2 deletions include/ylt/coro_io/client_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class client_pool : public std::enable_shared_from_this<
do {
ELOG_TRACE << "try to reconnect client{" << client.get() << "},host:{"
<< client->get_host() << ":" << client->get_port()
<< "}, try count:" << i << "max retry limit:"
<< "}, try count:" << i + 1 << "max retry limit:"
<< self->pool_config_.connect_retry_count;
auto pre_time_point = std::chrono::steady_clock::now();
bool ok = client_t::is_ok(co_await client->connect(self->host_name_));
Expand Down Expand Up @@ -245,7 +245,6 @@ class client_pool : public std::enable_shared_from_this<
std::chrono::milliseconds reconnect_wait_time{1000};
std::chrono::milliseconds idle_timeout{30000};
std::chrono::milliseconds short_connect_idle_timeout{1000};
std::chrono::milliseconds max_connection_time{60000};
typename client_t::config client_config;
};

Expand Down
17 changes: 9 additions & 8 deletions include/ylt/coro_rpc/impl/coro_rpc_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class coro_rpc_client {
struct config {
uint64_t client_id = get_global_client_id();
std::chrono::milliseconds timeout_duration =
std::chrono::milliseconds{5000};
std::chrono::milliseconds{30000};
std::string host;
std::string port;
bool enable_tcp_no_delay = true;
Expand Down Expand Up @@ -234,7 +234,7 @@ class coro_rpc_client {
[[nodiscard]] async_simple::coro::Lazy<coro_rpc::err_code> connect(
std::string host, std::string port,
std::chrono::steady_clock::duration timeout_duration =
std::chrono::seconds(5)) {
std::chrono::seconds(30)) {
auto lock_ok = connect_mutex_.tryLock();
if (!lock_ok) {
co_await connect_mutex_.coScopedLock();
Expand All @@ -252,7 +252,7 @@ class coro_rpc_client {
[[nodiscard]] async_simple::coro::Lazy<coro_rpc::err_code> connect(
std::string_view endpoint,
std::chrono::steady_clock::duration timeout_duration =
std::chrono::seconds(5)) {
std::chrono::seconds(30)) {
auto pos = endpoint.find(':');
auto lock_ok = connect_mutex_.tryLock();
if (!lock_ok) {
Expand Down Expand Up @@ -296,7 +296,7 @@ class coro_rpc_client {
~coro_rpc_client() { close(); }

/*!
* Call RPC function with default timeout (5 second)
* Call RPC function with default timeout (30 second)
*
* @tparam func the address of RPC function
* @tparam Args the type of arguments
Expand All @@ -306,7 +306,8 @@ class coro_rpc_client {
template <auto func, typename... Args>
async_simple::coro::Lazy<rpc_result<decltype(get_return_type<func>())>> call(
Args &&...args) {
return call_for<func>(std::chrono::seconds(5), std::forward<Args>(args)...);
return call_for<func>(std::chrono::seconds(30),
std::forward<Args>(args)...);
}

/*!
Expand Down Expand Up @@ -919,7 +920,7 @@ class coro_rpc_client {
async_simple::coro::Lazy<async_simple::coro::Lazy<
async_rpc_result<decltype(get_return_type<func>())>>>
send_request(Args &&...args) {
return send_request_for_with_attachment<func>(std::chrono::seconds{5}, {},
return send_request_for_with_attachment<func>(std::chrono::seconds{30}, {},
std::forward<Args>(args)...);
}

Expand All @@ -928,7 +929,7 @@ class coro_rpc_client {
async_rpc_result<decltype(get_return_type<func>())>>>
send_request_with_attachment(std::string_view request_attachment,
Args &&...args) {
return send_request_for_with_attachment<func>(std::chrono::seconds{5},
return send_request_for_with_attachment<func>(std::chrono::seconds{30},
request_attachment,
std::forward<Args>(args)...);
}
Expand All @@ -937,7 +938,7 @@ class coro_rpc_client {
async_simple::coro::Lazy<async_simple::coro::Lazy<
async_rpc_result<decltype(get_return_type<func>())>>>
send_request_for(Args &&...args) {
return send_request_for_with_attachment<func>(std::chrono::seconds{5},
return send_request_for_with_attachment<func>(std::chrono::seconds{30},
std::string_view{},
std::forward<Args>(args)...);
}
Expand Down
2 changes: 1 addition & 1 deletion include/ylt/standalone/cinatra/coro_http_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2424,7 +2424,7 @@ class coro_http_client : public std::enable_shared_from_this<coro_http_client> {
bool enable_follow_redirect_ = false;
bool enable_timeout_ = false;
std::chrono::steady_clock::duration conn_timeout_duration_ =
std::chrono::seconds(8);
std::chrono::seconds(30);
std::chrono::steady_clock::duration req_timeout_duration_ =
std::chrono::seconds(60);
bool enable_tcp_no_delay_ = true;
Expand Down

0 comments on commit 8ff1f3b

Please sign in to comment.