@@ -1964,14 +1964,6 @@ void output_flex_t::relation_modify(osmium::Relation const &rel)
19641964 relation_add (rel);
19651965}
19661966
1967- void output_flex_t::init_clone ()
1968- {
1969- for (auto &table : m_table_connections) {
1970- table.connect (get_options ()->database_options .conninfo ());
1971- table.prepare ();
1972- }
1973- }
1974-
19751967void output_flex_t::start ()
19761968{
19771969 for (auto &table : m_table_connections) {
@@ -1993,12 +1985,11 @@ output_flex_t::output_flex_t(output_flex_t const *other,
19931985 m_process_relation(other->m_process_relation),
19941986 m_select_relation_members(other->m_select_relation_members)
19951987{
1996- assert (m_table_connections.empty ());
19971988 for (auto &table : *m_tables) {
1998- m_table_connections.emplace_back (&table, m_copy_thread);
1989+ auto &tc = m_table_connections.emplace_back (&table, m_copy_thread);
1990+ tc.connect (get_options ()->database_options .conninfo ());
1991+ tc.prepare ();
19991992 }
2000-
2001- init_clone ();
20021993}
20031994
20041995std::shared_ptr<output_t >
@@ -2015,8 +2006,6 @@ output_flex_t::output_flex_t(
20152006: output_t (mid, std::move(thread_pool), o), m_copy_thread(copy_thread),
20162007 m_expire (o.expire_tiles_zoom, o.expire_tiles_max_bbox, o.projection)
20172008{
2018- assert (copy_thread);
2019-
20202009 init_lua (get_options ()->style );
20212010
20222011 // If the osm2pgsql.select_relation_members() Lua function is defined
@@ -2031,7 +2020,6 @@ output_flex_t::output_flex_t(
20312020 " No tables defined in Lua config. Nothing to do!" };
20322021 }
20332022
2034- assert (m_table_connections.empty ());
20352023 for (auto &table : *m_tables) {
20362024 m_table_connections.emplace_back (&table, m_copy_thread);
20372025 }
0 commit comments