v0.52 Improve handling and look at how we can improve ActiveRecord config for PostgreSQL and avoid insufficient pool size

This commit is contained in:
David Sainty 2024-08-19 22:04:37 +10:00
parent e312a4ed12
commit 90ee7854b8

View File

@ -1186,7 +1186,7 @@ class GossamerForumsImporter < ImportScripts::Base
# 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
# ActiveRecord::Base.connected_to(pool: 'CustomPool') do # ActiveRecord::Base.connected_to(pool: 'CustomPool') do
ActiveRecord::Base.connected_to do ActiveRecord::Base.connected_to(role: :writing) do
post_status = fetch_post_status(post_id) post_status = fetch_post_status(post_id)
if post_status.nil? || post_status == 0 if post_status.nil? || post_status == 0
puts "Starting import for post_id #{post_id}" puts "Starting import for post_id #{post_id}"