diff --git a/.gossamer_forums.rb.swp b/.gossamer_forums.rb.swp new file mode 100644 index 0000000..87227c2 Binary files /dev/null and b/.gossamer_forums.rb.swp differ diff --git a/gossamer_forums.rb b/gossamer_forums.rb index 79b579a..25c8026 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1,7 +1,7 @@ # Federated Computer, Inc. # David Sainty 2024 A.D. # Gossamer Threads to Discourse -- Migration-Import Script -# v0.48.6 48-48-48, add handling for deleted-former user as OP poster +# v0.48.8 20-20-20, efforts to deal with MySQL connectionf failure issue require 'mysql2' require 'open-uri' @@ -38,7 +38,7 @@ class GossamerForumsImporter < ImportScripts::Base username: 'admin', password: "yxnh93Ybbz2Nm8#mp28zCVv", host: 'slowtwitch.northend.network', - pool: 24, # Adjust based on concurrency needs + pool: 20, # Adjust based on concurrency needs timeout: 5000 ) @@ -1132,15 +1132,11 @@ class GossamerForumsImporter < ImportScripts::Base # Use CachedThreadPool for dynamic thread management #### pool = Concurrent::CachedThreadPool.new ###### pool = Concurrent::FixedThreadPool.new(7) - pool = Concurrent::FixedThreadPool.new(24) + pool = Concurrent::FixedThreadPool.new(20) # Define the connection pool inside the method ###### mariadb_pool = ConnectionPool.new(size: 14, timeout: 100) do - mariadb_pool = ConnectionPool.new(size: 24, timeout: 100) do -# host: "172.99.0.10", -# username: "admin", -# password: "x0YGLA9252iiTFQuqaM0ROX8FmQzZuUu", -# database: "slowtwitch" + mariadb_pool = ConnectionPool.new(size: 20, timeout: 100) do Mysql2::Client.new( host: "slowtwitch.northend.network", username: "admin", @@ -1158,7 +1154,7 @@ class GossamerForumsImporter < ImportScripts::Base parent_post_ids = result.map { |row| row['post_id'] } # parent_post_count = parent_post_ids.count - batch_size = 1000 # Set our batch size for number of posts to import in a single batch + batch_size = 30 # Set our batch size for number of posts to import in a single batch #### current_post_batch = 0 # Set our current batch number. This tracks the current batch of posts being processed.