From 9f6d775c174985ce36bd15007cc3b46a68f1be0d Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Tue, 20 Jun 2023 22:41:59 -0500 Subject: [PATCH] Reduce product cache limit --- scwx-qt/source/scwx/qt/manager/timeline_manager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp b/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp index 2df72d32..667fa4dd 100644 --- a/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/timeline_manager.cpp @@ -1,3 +1,5 @@ +#define NOMINMAX + #include #include #include @@ -392,9 +394,10 @@ void TimelineManager::Impl::UpdateCacheLimit( auto endIter = util::GetBoundedElementIterator(volumeTimes, endTime); std::size_t numVolumeScans = std::distance(startIter, endIter) + 1; - // Dynamically update maximum cached volume scans to 1.5x the loop length - radarProductManager->SetCacheLimit( - static_cast(numVolumeScans * 1.5)); + // Dynamically update maximum cached volume scans to the lesser of + // either 1.5x the loop length or 5 greater than the loop length + radarProductManager->SetCacheLimit(std::min( + static_cast(numVolumeScans * 1.5), numVolumeScans + 5u)); } void TimelineManager::Impl::Play()