Merge pull request #783 from linhaojun857/fix_Pool.hpp

fix function:createShared in PoolTemplate
This commit is contained in:
Leonid Stryzhevskyi 2023-07-22 01:25:39 +03:00 committed by GitHub
commit 0b3a66c47c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -353,10 +353,11 @@ public:
static std::shared_ptr<PoolTemplate> createShared(const std::shared_ptr<Provider<TResource>>& provider,
v_int64 maxResources,
const std::chrono::duration<v_int64, std::micro>& maxResourceTTL)
const std::chrono::duration<v_int64, std::micro>& maxResourceTTL,
const std::chrono::duration<v_int64, std::micro>& timeout)
{
/* "new" is called directly to keep constructor private */
auto ptr = std::shared_ptr<PoolTemplate>(new PoolTemplate(provider, maxResources, maxResourceTTL.count()));
auto ptr = std::shared_ptr<PoolTemplate>(new PoolTemplate(provider, maxResources, maxResourceTTL.count(), timeout));
startCleanupTask(ptr);
return ptr;
}