Remove initial filling

This commit is contained in:
kssenii 2021-03-19 08:33:04 +00:00
parent 9057aad798
commit a0f717619c
2 changed files with 0 additions and 12 deletions

View File

@ -19,7 +19,6 @@ PostgreSQLConnectionPool::PostgreSQLConnectionPool(
{
address = host + ':' + std::to_string(port);
connection_str = formatConnectionString(std::move(dbname), std::move(host), port, std::move(user), std::move(password));
initialize();
}
@ -28,7 +27,6 @@ PostgreSQLConnectionPool::PostgreSQLConnectionPool(const PostgreSQLConnectionPoo
, connection_str(other.connection_str)
, address(other.address)
{
initialize();
}
@ -45,14 +43,6 @@ std::string PostgreSQLConnectionPool::formatConnectionString(
}
void PostgreSQLConnectionPool::initialize()
{
/// No connection is made, just fill pool with non-connected connection objects.
for (size_t i = 0; i < POSTGRESQL_POOL_DEFAULT_SIZE; ++i)
pool->push(std::make_shared<PostgreSQLConnection>(connection_str, address));
}
PostgreSQLConnectionHolderPtr PostgreSQLConnectionPool::get()
{
PostgreSQLConnectionPtr connection;

View File

@ -41,8 +41,6 @@ private:
static std::string formatConnectionString(
std::string dbname, std::string host, UInt16 port, std::string user, std::string password);
void initialize();
PoolPtr pool;
std::string connection_str, address;
};