diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2017-09-12 18:34:44 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2017-09-12 18:59:43 +0300 |
commit | 01de08f6a79692f8b9f4060db90af6f79edf53ed (patch) | |
tree | 9aedcad91bb88cbefb53df3ac701cb382e9ac3b7 | |
parent | e1b1187c39564044b363972530847f33cb7a94fe (diff) |
Fixed crash and added loggingios-store-752beta-1001beta-1000
-rw-r--r-- | storage/diff_scheme/diff_manager.cpp | 17 | ||||
-rw-r--r-- | storage/diff_scheme/diff_manager.hpp | 2 | ||||
-rw-r--r-- | storage/storage.cpp | 14 |
3 files changed, 28 insertions, 5 deletions
diff --git a/storage/diff_scheme/diff_manager.cpp b/storage/diff_scheme/diff_manager.cpp index d6dfcb63df..ce5fe7995a 100644 --- a/storage/diff_scheme/diff_manager.cpp +++ b/storage/diff_scheme/diff_manager.cpp @@ -51,8 +51,8 @@ void Manager::ApplyDiff(ApplyDiffParams && p, std::function<void(bool const resu { m_workerThread.Push([this, p, task] { - CHECK(p.m_diffFile, ()); - CHECK(p.m_oldMwmFile, ()); + CHECK(p.m_diffFile, ("No diff at path:", p.m_diffFile->GetPath(MapOptions::Diff))); + CHECK(p.m_oldMwmFile, ("No old mwm at path:", p.m_oldMwmFile->GetPath(MapOptions::Map))); auto & diffReadyPath = p.m_diffReadyPath; auto & diffFile = p.m_diffFile; @@ -147,5 +147,18 @@ bool Manager::IsPossibleToAutoupdate() const } return true; } + +std::string DebugPrint(Status status) +{ + switch (status) + { + case Status::Undefined: + return "Undefined"; + case Status::Available: + return "Available"; + case Status::NotAvailable: + return "NotAvailable"; + } +} } // namespace diffs } // namespace storage diff --git a/storage/diff_scheme/diff_manager.hpp b/storage/diff_scheme/diff_manager.hpp index 0aa25f95ee..1e9c0a84d9 100644 --- a/storage/diff_scheme/diff_manager.hpp +++ b/storage/diff_scheme/diff_manager.hpp @@ -56,5 +56,7 @@ private: base::ObserverListUnsafe<Observer> m_observers; base::WorkerThread m_workerThread; }; + +std::string DebugPrint(Status status); } // namespace diffs } // namespace storage diff --git a/storage/storage.cpp b/storage/storage.cpp index 1fca6494ca..3df1370263 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -615,8 +615,11 @@ void Storage::DownloadNextCountryFromQueue() { OnMapDownloadFinished(countryId, false /* success */, queuedCountry.GetInitOptions()); NotifyStatusChangedForHierarchy(countryId); - CorrectJustDownloadedAndQueue(m_queue.begin()); - DownloadNextCountryFromQueue(); + if (!m_queue.empty()) + { + CorrectJustDownloadedAndQueue(m_queue.begin()); + DownloadNextCountryFromQueue(); + } return; } @@ -807,7 +810,10 @@ void Storage::OnServerListDownloaded(vector<string> const & urls) break; case Status::Available: if (!m_diffManager.HasDiffFor(queuedCountry.GetCountryId())) + { + LOG(LINFO, ("No diff for the country:", queuedCountry.GetCountryId())); queuedCountry.ResetToDefaultOptions(); + } break; } } @@ -844,9 +850,10 @@ void Storage::RegisterDownloadedFiles(TCountryId const & countryId, MapOptions o { ASSERT_THREAD_CHECKER(m_threadChecker, ()); - auto const fn = [this, countryId](bool isSuccess) + auto const fn = [this, countryId, options](bool isSuccess) { ASSERT_THREAD_CHECKER(m_threadChecker, ()); + LOG(LINFO, ("Process downloaded file:", countryId, "with option:", options)); if (!isSuccess) { OnDownloadFailed(countryId); @@ -1470,6 +1477,7 @@ bool Storage::IsPossibleToAutoupdate() const void Storage::OnDiffStatusReceived(diffs::Status const status) { + LOG(LINFO, ("Received diff status:", status)); if (status != diffs::Status::NotAvailable) { for (auto const & localDiff : m_notAppliedDiffs) |