From e94c23d538d2ef27525a204bcbcc321151b42cf5 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Thu, 15 May 2025 23:58:58 +0300 Subject: [PATCH] [traffic] Insert mew messages into cache but skip deduplication for now Signed-off-by: mvglasow --- map/traffic_manager.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/map/traffic_manager.cpp b/map/traffic_manager.cpp index 1ac54f318..62a7148ed 100644 --- a/map/traffic_manager.cpp +++ b/map/traffic_manager.cpp @@ -542,6 +542,14 @@ void TrafficManager::DecodeFirstMessage() m_feedQueue.erase(m_feedQueue.begin()); } +/* + * TODO this breaks things in the current test setup. + * When TrafficManager starts up and processes the first feed, maps are not loaded yet and messages + * cannot be decoded, so they are added to the cache without segments. + * The next feed (being a static file) returns the same data, so this check causes the message to + * get ignored as it has not changed. + */ +#if 0 // check if message is actually newer auto it = m_messageCache.find(message.m_id); bool process = (it == m_messageCache.end()); @@ -552,11 +560,12 @@ void TrafficManager::DecodeFirstMessage() LOG(LINFO, ("message", message.m_id, "is already in cache, skipping")); return; } +#endif LOG(LINFO, (" ", message.m_id, ":", message)); DecodeMessage(message); // store message in cache - //m_messageCache.insert_or_assign(message.m_id, message); + m_messageCache.insert_or_assign(message.m_id, message); // store message coloring in AllMwmColoring // TODO trigger full cache processing if segments were removed or traffic has eased traffxml::MergeMultiMwmColoring(message.m_decoded, m_allMwmColoring);