MCPcopy Create free account
hub / github.com/comaps/comaps / RestoreDownloadQueue

Method RestoreDownloadQueue

libs/storage/storage.cpp:801–821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

799}
800
801void Storage::RestoreDownloadQueue()
802{
803 string download;
804 settings::TryGet(kDownloadQueueKey, download);
805 if (download.empty())
806 return;
807
808 strings::Tokenize(download, ";", [this](string_view v)
809 {
810 auto const it = base::FindIf(
811 m_notAppliedDiffs, [this, v](LocalCountryFile const & localDiff) { return v == FindCountryId(localDiff); });
812
813 if (it == m_notAppliedDiffs.end())
814 {
815 string const s(v);
816 auto localFile = GetLatestLocalFile(s);
817 auto isUpdate = localFile && localFile->OnDisk(MapFileType::Map);
818 DownloadNode(s, isUpdate);
819 }
820 });
821}
822
823void Storage::DownloadCountry(CountryId const & countryId, MapFileType type)
824{

Callers 2

LoadMapsSyncMethod · 0.80
LoadMapsAsyncMethod · 0.80

Calls 6

TryGetFunction · 0.85
OnDiskMethod · 0.80
TokenizeFunction · 0.50
FindIfFunction · 0.50
emptyMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected