diff --git a/src/Controller/AsyncExecutor.hh b/src/Controller/AsyncExecutor.hh index 5298016b..ea2097cd 100644 --- a/src/Controller/AsyncExecutor.hh +++ b/src/Controller/AsyncExecutor.hh @@ -95,6 +95,7 @@ public: } ~AsyncExecutor() { + _ioc.stop(); if (_ioc_thread.joinable()) { _ioc_thread.join(); } diff --git a/src/Infrastructure/Network/NetworkClient.cc b/src/Infrastructure/Network/NetworkClient.cc index 7a439467..ee892bc2 100644 --- a/src/Infrastructure/Network/NetworkClient.cc +++ b/src/Infrastructure/Network/NetworkClient.cc @@ -20,6 +20,13 @@ NetworkClient::NetworkClient(net::ssl::context& ctx) : _ctx(ctx) , _manager(std::make_unique(_ctx, true)) {} +NetworkClient* NetworkClient::getInstance() { + static ssl::context ctx(ssl::context::sslv23); + ctx.set_default_verify_paths(); + static NetworkClient s_instance(ctx); + return &s_instance; +} + Task> NetworkClient::loginViaSastLink(const std::string& code) { auto result = co_await this->request(http::verb::post, endpoint("/login/link"), @@ -38,13 +45,6 @@ Task> NetworkClient::loginViaSastLink(const std::string& co_return Ok(entity); } -NetworkClient* NetworkClient::getInstance() { - static ssl::context ctx(ssl::context::sslv23); - ctx.set_default_verify_paths(); - static NetworkClient s_instance(ctx); - return &s_instance; -} - Task> NetworkClient::getUserInfo() { auto result = co_await this->request(http::verb::get, endpoint("/v2/user/profile")); if (result.isErr())