Skip to content

Commit

Permalink
[coro_http] reconnect immediately at first try
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Jul 19, 2023
1 parent ed5fb1d commit 6ce93d7
Showing 1 changed file with 1 addition and 2 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 @@ -99,8 +99,7 @@ class client_pool : public std::enable_shared_from_this<

async_simple::coro::Lazy<std::unique_ptr<client_t>> reconnect(
std::unique_ptr<client_t> client) {
bool ok = false;

bool ok = client_t::is_ok(co_await client->reconnect(host_name_));
for (int i = 0; !ok && i < pool_config_.connect_retry_count; ++i) {
co_await coro_io::sleep_for(pool_config_.reconnect_wait_time);
ok = (client_t::is_ok(co_await client->reconnect(host_name_)));
Expand Down

0 comments on commit 6ce93d7

Please sign in to comment.