v0.43 Move to connection pooling for MySQL problem

This commit is contained in:
David Sainty 2024-08-18 03:12:07 +10:00
parent 855a0a9e46
commit 698c1b0f26

View File

@ -18,6 +18,8 @@ require 'concurrent'
require 'sys/proctable' require 'sys/proctable'
require 'connection_pool'
require File.expand_path("../../../../config/environment", __FILE__) require File.expand_path("../../../../config/environment", __FILE__)
# require_relative '../base' # require_relative '../base'
require File.expand_path("../../../../script/import_scripts/base", __FILE__) require File.expand_path("../../../../script/import_scripts/base", __FILE__)
@ -1067,7 +1069,7 @@ 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; # 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 def threaded_topic_import
# Define the connection pool inside the method # Define the connection pool inside the method
mariadb_pool = ConnectionPool.new(size: 10, timeout: 5) do mariadb_pool = ConnectionPool.new(size: 20, timeout: 500) do
Mysql2::Client.new( Mysql2::Client.new(
host: "slowtwitch.northend.network", host: "slowtwitch.northend.network",
username: "admin", username: "admin",