Get level2 chunks and archive working together, reduce logging of level2 chunks

This commit is contained in:
AdenKoperczak 2025-04-07 18:23:29 -04:00
parent 094d286b41
commit 63585af26d
No known key found for this signature in database
GPG key ID: 9843017036F62EE7
4 changed files with 43 additions and 25 deletions

View file

@ -618,10 +618,13 @@ AwsLevel2ChunksDataProvider::LoadObjectByTime(
std::chrono::system_clock::time_point time)
{
std::unique_lock lock(p->scansMutex_);
static const std::chrono::system_clock::time_point epoch {};
if (p->currentScan_.valid_ && time >= p->currentScan_.time_)
if (p->currentScan_.valid_ &&
(time == epoch || time >= p->currentScan_.time_))
{
return p->currentScan_.nexradFile_;
return std::make_shared<wsr88d::Ar2vFile>(p->currentScan_.nexradFile_,
p->lastScan_.nexradFile_);
}
else if (p->lastScan_.valid_ && time >= p->lastScan_.time_)
{
@ -629,7 +632,6 @@ AwsLevel2ChunksDataProvider::LoadObjectByTime(
}
else
{
logger_->warn("Could not find scan with time");
return nullptr;
}
}
@ -637,6 +639,7 @@ AwsLevel2ChunksDataProvider::LoadObjectByTime(
std::shared_ptr<wsr88d::NexradFile>
AwsLevel2ChunksDataProvider::LoadLatestObject()
{
std::unique_lock lock(p->scansMutex_);
return std::make_shared<wsr88d::Ar2vFile>(p->currentScan_.nexradFile_,
p->lastScan_.nexradFile_);
//return p->currentScan_.nexradFile_;