v0.42.1 Rewrite and simplication of concurrent-ruby support
This commit is contained in:
parent
23a65c5f5c
commit
7b3a9babcb
@ -1131,7 +1131,12 @@ class GossamerForumsImporter < ImportScripts::Base
|
|||||||
database: "slowtwitch"
|
database: "slowtwitch"
|
||||||
)
|
)
|
||||||
puts "PP 22 -- #{post_id}"
|
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
|
begin
|
||||||
# Use connection pooling for PostgreSQL and synchronize access to shared resources
|
# Use connection pooling for PostgreSQL and synchronize access to shared resources
|
||||||
ActiveRecord::Base.connection_pool.with_connection do
|
ActiveRecord::Base.connection_pool.with_connection do
|
||||||
@ -1153,7 +1158,15 @@ class GossamerForumsImporter < ImportScripts::Base
|
|||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
# Ensure the MariaDB connection is closed after processing
|
# 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
|
mysql_client.close if mysql_client
|
||||||
|
puts "** CLOSED MariaDB client"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user