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

Method CancelDownloadNode

libs/storage/storage.cpp:2077–2099  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2075}
2076
2077void Storage::CancelDownloadNode(CountryId const & countryId)
2078{
2079 CHECK_THREAD_CHECKER(m_threadChecker, ());
2080
2081 LOG(LINFO, ("Cancelling the downloading of", countryId));
2082
2083 auto const setQueue = GetQueuedCountries(m_downloader->GetQueue());
2084
2085 ForEachInSubtree(countryId, [&](CountryId const & descendantId, bool /* groupNode */)
2086 {
2087 auto needNotify = false;
2088 if (setQueue.count(descendantId) != 0)
2089 needNotify = DeleteCountryFilesFromDownloader(descendantId);
2090
2091 if (m_failedCountries.erase(descendantId) != 0)
2092 needNotify = true;
2093
2094 m_downloadingCountries.erase(countryId);
2095
2096 if (needNotify)
2097 NotifyStatusChangedForHierarchy(descendantId);
2098 });
2099}
2100
2101void Storage::RetryDownloadNode(CountryId const & countryId)
2102{

Calls 4

GetQueuedCountriesFunction · 0.85
GetQueueMethod · 0.45
countMethod · 0.45
eraseMethod · 0.45

Tested by 1