mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 05:03:39 +08:00
FIX: Create and consume temp table inside a transaction (#7030)
To prevent access issue in pgbouncer which runs in transaction pooling
This commit is contained in:
parent
1f4ace4f56
commit
da1ff2da2c
|
@ -34,6 +34,7 @@ class S3Inventory
|
||||||
download_inventory_files_to_tmp_directory
|
download_inventory_files_to_tmp_directory
|
||||||
decompress_inventory_files
|
decompress_inventory_files
|
||||||
|
|
||||||
|
ActiveRecord::Base.transaction do
|
||||||
begin
|
begin
|
||||||
table_name = "#{inventory_id}_inventory"
|
table_name = "#{inventory_id}_inventory"
|
||||||
connection = ActiveRecord::Base.connection.raw_connection
|
connection = ActiveRecord::Base.connection.raw_connection
|
||||||
|
@ -68,6 +69,7 @@ class S3Inventory
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def download_inventory_files_to_tmp_directory
|
def download_inventory_files_to_tmp_directory
|
||||||
files.each do |file|
|
files.each do |file|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user