@@ -174,17 +174,13 @@ class multithreaded_processor
174174public:
175175 using output_vec_t = std::vector<std::shared_ptr<output_t >>;
176176
177- multithreaded_processor (std::shared_ptr<middle_t > const &mid,
177+ multithreaded_processor (std::string const &conninfo,
178+ std::shared_ptr<middle_t > const &mid,
178179 output_vec_t outs, size_t thread_count)
179180 : m_outputs(std::move(outs))
180181 {
181182 assert (!m_outputs.empty ());
182183
183- // The database connection info should be the same for all outputs,
184- // we take it arbitrarily from the first.
185- std::string const &conninfo =
186- m_outputs[0 ]->get_options ()->database_options .conninfo ();
187-
188184 // For each thread we create clones of all the outputs.
189185 m_clones.resize (thread_count);
190186 for (size_t i = 0 ; i < thread_count; ++i) {
@@ -387,11 +383,12 @@ void osmdata_t::stop() const
387383 // In append mode there might be dependent objects pending that we
388384 // need to process.
389385 if (opts->append && m_dependency_manager->has_pending ()) {
390- multithreaded_processor proc{m_mid, m_outs ,
391- (std::size_t )opts->num_procs };
386+ multithreaded_processor proc{opts-> database_options . conninfo (), m_mid ,
387+ m_outs, (std::size_t )opts->num_procs };
392388
393389 proc.process_ways (m_dependency_manager->get_pending_way_ids ());
394- proc.process_relations (m_dependency_manager->get_pending_relation_ids ());
390+ proc.process_relations (
391+ m_dependency_manager->get_pending_relation_ids ());
395392 proc.merge_expire_trees ();
396393 }
397394
0 commit comments