From 53ade7fc53031777625ae6e3d39b8cf95a91acb1 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sun, 6 Apr 2025 00:33:51 -0500 Subject: [PATCH] Don't load archived text products for days that have full coverage of live warning data --- .../source/scwx/qt/manager/text_event_manager.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp b/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp index b3d0fd3a..bac8b0e7 100644 --- a/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp @@ -119,6 +119,7 @@ public: std::chrono::hours loadHistoryDuration_ {kInitialLoadHistoryDuration_}; std::chrono::sys_time prevLoadTime_ {}; + std::chrono::sys_days archiveLimit_ {}; std::mutex archiveMutex_ {}; std::list archiveDates_ {}; @@ -215,7 +216,11 @@ void TextEventManager::SelectTime( for (auto& date : dates) { - p->LoadArchives(date); + if (p->archiveLimit_ == std::chrono::sys_days {} || + date < p->archiveLimit_) + { + p->LoadArchives(date); + } } } @@ -399,6 +404,11 @@ void TextEventManager::Impl::Refresh() startTime = std::min(startTime, prevLoadTime_); } + if (archiveLimit_ == std::chrono::sys_days {}) + { + archiveLimit_ = std::chrono::ceil(startTime); + } + auto updatedFiles = warningsProvider->LoadUpdatedFiles(startTime); // Store the load time and reset the load history duration