diff --git a/gossamer_forums.rb b/gossamer_forums.rb index 6d4c3c1..a009b5c 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1075,10 +1075,10 @@ class GossamerForumsImporter < ImportScripts::Base # Get list of TOPICS / OP posts, i.e. post ids that have no parent / root id - SELECT post_id FROM gforum_Post WHERE post_root_id = 0; def threaded_topic_import - # Update connection pool settings - ActiveRecord::Base.establish_connection( - ActiveRecord::Base.connection_db_config.configuration_hash.merge(pool: 40, timeout: 5000) - ) +## # Update connection pool settings +## ActiveRecord::Base.establish_connection( +## ActiveRecord::Base.connection_db_config.configuration_hash.merge(pool: 40, timeout: 5000) +## ) ### # Define the custom connection pool settings ### custom_pool = ActiveRecord::ConnectionAdapters::ConnectionPool.new( @@ -1184,9 +1184,9 @@ class GossamerForumsImporter < ImportScripts::Base end # Use connection pooling for PostgreSQL and synchronize access to shared resources - # ActiveRecord::Base.connection_pool.with_connection do + ActiveRecord::Base.connection_pool.with_connection do # ActiveRecord::Base.connected_to(pool: 'CustomPool') do - ActiveRecord::Base.connected_to(role: :writing) do + ## ActiveRecord::Base.connected_to(role: :writing) do post_status = fetch_post_status(post_id) if post_status.nil? || post_status == 0 puts "Starting import for post_id #{post_id}" @@ -1514,7 +1514,7 @@ class GossamerForumsImporter < ImportScripts::Base rescue ActiveRecord::RecordInvalid => e puts "---> ERROR importing topic with post_id #{row['post_id']}: #{e.message}" - # raise ActiveRecord::Rollback + raise ActiveRecord::Rollback end # end else