From 7b3a9babcb27eb5e2883dcfdd5e7c41cf181b713 Mon Sep 17 00:00:00 2001 From: saint Date: Sun, 18 Aug 2024 01:44:29 +1000 Subject: [PATCH] v0.42.1 Rewrite and simplication of concurrent-ruby support --- gossamer_forums.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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