@@ -194,7 +194,7 @@ class client_pool : public std::enable_shared_from_this<
194
194
co_await coro_io::sleep_for (wait_time, &client->get_executor ());
195
195
self = watcher.lock ();
196
196
++i;
197
- } while (i < self->pool_config_ .connect_retry_count );
197
+ } while (self && i < self->pool_config_ .connect_retry_count );
198
198
ELOG_WARN << " reconnect client{" << client.get () << " },host:{"
199
199
<< client->get_host () << " :" << client->get_port ()
200
200
<< " } out of max limit, stop retry. connect failed" ;
@@ -220,7 +220,7 @@ class client_pool : public std::enable_shared_from_this<
220
220
co_return ;
221
221
}
222
222
auto executor = self->io_context_pool_ .get_executor ();
223
- auto client = std::make_unique<client_t >(* executor);
223
+ auto client = std::make_unique<client_t >(executor);
224
224
if (!client->init_config (client_config))
225
225
AS_UNLIKELY {
226
226
ELOG_ERROR << " Init client config failed in host alive detect. That "
@@ -271,7 +271,7 @@ class client_pool : public std::enable_shared_from_this<
271
271
if (client == nullptr ) {
272
272
std::unique_ptr<client_t > cli;
273
273
auto executor = io_context_pool_.get_executor ();
274
- client = std::make_unique<client_t >(* executor);
274
+ client = std::make_unique<client_t >(executor);
275
275
if (!client->init_config (client_config))
276
276
AS_UNLIKELY {
277
277
ELOG_ERROR << " init client config failed." ;
@@ -298,8 +298,10 @@ class client_pool : public std::enable_shared_from_this<
298
298
this ->weak_from_this (), clients,
299
299
(std::max)(collect_time, std::chrono::milliseconds{50 }),
300
300
pool_config_.idle_queue_per_max_clear_count )
301
- .directlyStart ([](auto &&) {
302
- },coro_io::get_global_executor ());
301
+ .directlyStart (
302
+ [](auto &&) {
303
+ },
304
+ coro_io::get_global_executor ());
303
305
}
304
306
}
305
307
}
0 commit comments