From 1f4e7ca8331419f7b2397cf248f88869bf6f1b19 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Mon, 7 Oct 2024 15:16:23 +0100 Subject: [PATCH] #1870 check opened dbs --- libbatched-io/BatchedRotatingHistoricDbIO.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libbatched-io/BatchedRotatingHistoricDbIO.cpp b/libbatched-io/BatchedRotatingHistoricDbIO.cpp index 69be066e0..bcf3217fe 100644 --- a/libbatched-io/BatchedRotatingHistoricDbIO.cpp +++ b/libbatched-io/BatchedRotatingHistoricDbIO.cpp @@ -43,8 +43,8 @@ void BatchedRotatingHistoricDbIO::rotate( uint64_t timestamp ) { void BatchedRotatingHistoricDbIO::checkOpenedDbsAndCloseIfNeeded() { std::lock_guard< std::mutex > lock( mutex ); - if ( ( lastCleanup + std::chrono::seconds( 1000 ) > std::chrono::system_clock::now() ) && - dbsInUse.size() < 10 ) + if ( ( lastCleanup + OPENED_DB_CHECK_INTERVAL > std::chrono::system_clock::now() ) && + dbsInUse.size() < MAX_OPENED_DB_COUNT ) return; for ( auto it = dbsInUse.begin(); it != dbsInUse.end(); ) {