From 5c648f97c1a3889ac7ffd5dc9684fd4f0687cecd Mon Sep 17 00:00:00 2001 From: saint Date: Sun, 18 Aug 2024 01:08:13 +1000 Subject: [PATCH] v0.42.1 Rewrite and simplication of concurrent-ruby support --- gossamer_forums.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gossamer_forums.rb b/gossamer_forums.rb index 3ec9004..1849d95 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1132,7 +1132,7 @@ class GossamerForumsImporter < ImportScripts::Base ) puts "PP 22 -- #{post_id}" -## begin + begin # Use connection pooling for PostgreSQL and synchronize access to shared resources ActiveRecord::Base.connection_pool.with_connection do post_status = post_status(post_id) @@ -1146,15 +1146,15 @@ class GossamerForumsImporter < ImportScripts::Base puts "Skipping post_id #{post_id}, already processed." end end -## rescue => e + rescue => e puts "Error processing post ID #{post_id}: #{e.message}" sqlite_mutex.synchronize do mark_post_as_failed(post_id) end -## ensure + ensure # Ensure the MariaDB connection is closed after processing mysql_client.close if mysql_client -## end + end end end