diff options
author | Yuri Gorshenin <y@maps.me> | 2015-09-23 14:24:59 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:02:19 +0300 |
commit | fd503ac72e67c886b21879760373478345889597 (patch) | |
tree | 3447ef04dab681236ffb59faa01aada76bd1e494 /indexer/index.cpp | |
parent | f24a9d26821e0e8f39903d03495281a71ca9df94 (diff) |
[search] Fixed SearchEngine threading model.
Diffstat (limited to 'indexer/index.cpp')
-rw-r--r-- | indexer/index.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/indexer/index.cpp b/indexer/index.cpp index e9b5524dbb..dfce9dce8e 100644 --- a/indexer/index.cpp +++ b/indexer/index.cpp @@ -65,15 +65,21 @@ unique_ptr<MwmInfo> Index::CreateInfo(platform::LocalCountryFile const & localFi unique_ptr<MwmSet::MwmValueBase> Index::CreateValue(MwmInfo & info) const { + MwmInfoEx & infoEx = dynamic_cast<MwmInfoEx &>(info); + // Create a section with rank table if it does not exist. platform::LocalCountryFile const & localFile = info.GetLocalFile(); - try - { - search::RankTableBuilder::CreateIfNotExists(localFile); - } - catch (RootException const & e) + if (!infoEx.m_rankTableCtorCalled) { - LOG(LWARNING, ("Can't create rank table for:", localFile, ":", e.Msg())); + infoEx.m_rankTableCtorCalled = true; + try + { + search::RankTableBuilder::CreateIfNotExists(localFile); + } + catch (RootException const & e) + { + LOG(LWARNING, ("Can't create rank table for:", localFile, ":", e.Msg())); + } } unique_ptr<MwmValue> p(new MwmValue(localFile)); |