v0.47.1 Fix .id nil bug
This commit is contained in:
parent
8caa2027cb
commit
eb6ec24033
@ -1,7 +1,7 @@
|
||||
# Federated Computer, Inc.
|
||||
# David Sainty <saint@federated.computer> 2024 A.D.
|
||||
# Gossamer Threads to Discourse -- Migration-Import Script
|
||||
# v0.47.1 Fix .id nil bug
|
||||
# v0.48 Further attempts to address MariaDB craziness
|
||||
|
||||
require 'mysql2'
|
||||
require 'open-uri'
|
||||
@ -18,6 +18,7 @@ require 'concurrent'
|
||||
|
||||
require 'sys/proctable'
|
||||
|
||||
require 'active_record'
|
||||
require 'connection_pool'
|
||||
|
||||
require File.expand_path("../../../../config/environment", __FILE__)
|
||||
@ -28,6 +29,18 @@ class GossamerForumsImporter < ImportScripts::Base
|
||||
def initialize
|
||||
super
|
||||
begin
|
||||
|
||||
# Database configuration for ActiveRecord
|
||||
ActiveRecord::Base.establish_connection(
|
||||
adapter: 'postgresql',
|
||||
database: 'slowtwitch',
|
||||
username: 'admin',
|
||||
password: "yxnh93Ybbz2Nm8#mp28zCVv",
|
||||
host: 'slowtwitch.northend.network',
|
||||
pool: 20, # Adjust based on concurrency needs
|
||||
timeout: 5000
|
||||
)
|
||||
|
||||
# Initialize MySQL client to connect to Gossamer Forums database
|
||||
@mysql_client = Mysql2::Client.new(
|
||||
host: "slowtwitch.northend.network",
|
||||
@ -1077,10 +1090,12 @@ class GossamerForumsImporter < ImportScripts::Base
|
||||
|
||||
# Use CachedThreadPool for dynamic thread management
|
||||
#### pool = Concurrent::CachedThreadPool.new
|
||||
pool = Concurrent::FixedThreadPool.new(7)
|
||||
###### pool = Concurrent::FixedThreadPool.new(7)
|
||||
pool = Concurrent::FixedThreadPool.new(12)
|
||||
|
||||
# Define the connection pool inside the method
|
||||
mariadb_pool = ConnectionPool.new(size: 14, timeout: 100) do
|
||||
###### mariadb_pool = ConnectionPool.new(size: 14, timeout: 100) do
|
||||
mariadb_pool = ConnectionPool.new(size: 24, timeout: 100) do
|
||||
Mysql2::Client.new(
|
||||
host: "slowtwitch.northend.network",
|
||||
username: "admin",
|
||||
|
Loading…
Reference in New Issue
Block a user