Skip to content

Commit 6bfc01c

Browse files
author
patrick.qian
committed
fix after review
1 parent 14d3947 commit 6bfc01c

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

source/kraken/apply_disruption.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,6 @@ nt::VehicleJourney* create_vj_from_old_vj(nt::MetaVehicleJourney* mvj,
101101
return new_vj;
102102
}
103103

104-
std::string concatenate_impact_uris(const nt::MetaVehicleJourney& mvj) {
105-
std::stringstream impacts_uris;
106-
for (auto& mvj_impacts : mvj.modified_by) {
107-
if (auto i = mvj_impacts.lock()) {
108-
if (impacts_uris.str().find(i->disruption->uri) == std::string::npos) {
109-
impacts_uris << ":" << i->disruption->uri;
110-
}
111-
}
112-
}
113-
return impacts_uris.str();
114-
}
115-
116104
std::string make_new_vj_uri(const nt::MetaVehicleJourney* mvj, nt::RTLevel rt_level) {
117105
boost::uuids::random_generator gen;
118106
return "vehicle_journey:" + mvj->uri + ":" + type::get_string_from_rt_level(rt_level) + ":"

source/kraken/configuration.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ po::options_description get_options_description(const boost::optional<std::strin
9494
("BROKER.rt_topics", po::value<std::vector<std::string>>(), "list of realtime topic for this instance")
9595
("BROKER.timeout", po::value<int>()->default_value(200), "timeout for maintenance worker in millisecond")
9696
("BROKER.max_batch_nb", po::value<int>()->default_value(5000), "max number of realtime messages retrieved in a batch")
97-
("BROKER.total_retrieving_timeout", po::value<int>()->default_value(10000), "max total duration the worker is going to spend when retrieving messages")
97+
("BROKER.total_retrieving_timeout", po::value<int>()->default_value(10000), "max total duration the worker is going to spend when retrieving messages, in milliseconds")
9898
("BROKER.sleeptime", po::value<int>()->default_value(1), "sleeptime for maintenance worker in second")
9999
("BROKER.reconnect_wait", po::value<int>()->default_value(1), "Wait duration between connection attempts to rabbitmq, in seconds")
100100
("BROKER.queue", po::value<std::string>(), "rabbitmq's queue name to be bound")

source/kraken/maintenance_worker.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,7 @@ void MaintenanceWorker::handle_rt_in_batch(const std::vector<AmqpClient::Envelop
366366
bool autocomplete_rebuilding_activated = false;
367367
auto rt_action = RTAction::chaos;
368368

369-
std::unordered_set<std::string> applied_visited_id;
370-
for (auto& envelope : boost::adaptors::reverse(envelopes)) {
369+
for (auto& envelope : envelopes) {
371370
const auto routing_key = envelope->RoutingKey();
372371
LOG4CPLUS_DEBUG(logger, "realtime info received from " << routing_key);
373372
assert(envelope);
@@ -378,10 +377,6 @@ void MaintenanceWorker::handle_rt_in_batch(const std::vector<AmqpClient::Envelop
378377
}
379378
LOG4CPLUS_TRACE(logger, "received entity: " << feed_message.DebugString());
380379
for (const auto& entity : feed_message.entity()) {
381-
auto res = applied_visited_id.insert(entity.id());
382-
if (!res.second) {
383-
continue;
384-
}
385380
if (!data) {
386381
pt::ptime copy_begin = pt::microsec_clock::universal_time();
387382
data = data_manager.get_data_clone();

0 commit comments

Comments
 (0)