[traffic] Insert mew messages into cache but skip deduplication for now

Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
mvglasow
2025-05-15 23:58:58 +03:00
parent 2ba3030366
commit e94c23d538

View File

@@ -542,6 +542,14 @@ void TrafficManager::DecodeFirstMessage()
m_feedQueue.erase(m_feedQueue.begin()); 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 // check if message is actually newer
auto it = m_messageCache.find(message.m_id); auto it = m_messageCache.find(message.m_id);
bool process = (it == m_messageCache.end()); bool process = (it == m_messageCache.end());
@@ -552,11 +560,12 @@ void TrafficManager::DecodeFirstMessage()
LOG(LINFO, ("message", message.m_id, "is already in cache, skipping")); LOG(LINFO, ("message", message.m_id, "is already in cache, skipping"));
return; return;
} }
#endif
LOG(LINFO, (" ", message.m_id, ":", message)); LOG(LINFO, (" ", message.m_id, ":", message));
DecodeMessage(message); DecodeMessage(message);
// store message in cache // 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 // store message coloring in AllMwmColoring
// TODO trigger full cache processing if segments were removed or traffic has eased // TODO trigger full cache processing if segments were removed or traffic has eased
traffxml::MergeMultiMwmColoring(message.m_decoded, m_allMwmColoring); traffxml::MergeMultiMwmColoring(message.m_decoded, m_allMwmColoring);