mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:30:05 +00:00
Don't load archived text products for days that have full coverage of live warning data
This commit is contained in:
parent
02ec27dd2f
commit
53ade7fc53
1 changed files with 11 additions and 1 deletions
|
|
@ -119,6 +119,7 @@ public:
|
||||||
|
|
||||||
std::chrono::hours loadHistoryDuration_ {kInitialLoadHistoryDuration_};
|
std::chrono::hours loadHistoryDuration_ {kInitialLoadHistoryDuration_};
|
||||||
std::chrono::sys_time<std::chrono::hours> prevLoadTime_ {};
|
std::chrono::sys_time<std::chrono::hours> prevLoadTime_ {};
|
||||||
|
std::chrono::sys_days archiveLimit_ {};
|
||||||
|
|
||||||
std::mutex archiveMutex_ {};
|
std::mutex archiveMutex_ {};
|
||||||
std::list<std::chrono::sys_days> archiveDates_ {};
|
std::list<std::chrono::sys_days> archiveDates_ {};
|
||||||
|
|
@ -215,7 +216,11 @@ void TextEventManager::SelectTime(
|
||||||
|
|
||||||
for (auto& date : dates)
|
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_);
|
startTime = std::min(startTime, prevLoadTime_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (archiveLimit_ == std::chrono::sys_days {})
|
||||||
|
{
|
||||||
|
archiveLimit_ = std::chrono::ceil<std::chrono::days>(startTime);
|
||||||
|
}
|
||||||
|
|
||||||
auto updatedFiles = warningsProvider->LoadUpdatedFiles(startTime);
|
auto updatedFiles = warningsProvider->LoadUpdatedFiles(startTime);
|
||||||
|
|
||||||
// Store the load time and reset the load history duration
|
// Store the load time and reset the load history duration
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue