diff --git a/gossamer_forums.rb b/gossamer_forums.rb index 505f8d1..7ef109c 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1131,7 +1131,12 @@ class GossamerForumsImporter < ImportScripts::Base database: "slowtwitch" ) puts "PP 22 -- #{post_id}" - + puts " FIRST Checking MySQL connection status..." + if mysql_client.query('SELECT 1').nil? + puts " MySQL connection is not valid" + else + puts " MySQL connection is valid" + end begin # Use connection pooling for PostgreSQL and synchronize access to shared resources ActiveRecord::Base.connection_pool.with_connection do @@ -1153,7 +1158,15 @@ class GossamerForumsImporter < ImportScripts::Base end ensure # Ensure the MariaDB connection is closed after processing + puts "PP 22 -- #{post_id}" + puts " FINAL Checking MySQL connection status..." + if mysql_client.query('SELECT 1').nil? + puts " MySQL connection is not valid" + else + puts " MySQL connection is valid" + end mysql_client.close if mysql_client + puts "** CLOSED MariaDB client" end end end