このコミットが含まれているのは:
@@ -6,6 +6,13 @@ class CountsExporter
|
||||
'summary_columns', 'nested_json', 'child_sort', 'labels'].freeze
|
||||
attr_reader :format, :resource
|
||||
|
||||
def self.with_read_snapshot(&block)
|
||||
# A caller-owned transaction already owns the read view (including fixtures).
|
||||
# MySQL cannot change isolation inside it. Standalone workers always start RR.
|
||||
options = ApplicationRecord.connection.transaction_open? ? {} : { isolation: :repeatable_read }
|
||||
ApplicationRecord.transaction(**options, &block)
|
||||
end
|
||||
|
||||
def initialize(params, language_code:)
|
||||
params = CountsResourceDefinition.normalise_params(params)
|
||||
if params.key?('definition')
|
||||
@@ -52,7 +59,7 @@ class CountsExporter
|
||||
return @table_export.body(progress:, phase:) if @table_export
|
||||
|
||||
Enumerator.new do |output|
|
||||
ApplicationRecord.transaction(isolation: :repeatable_read) do
|
||||
self.class.with_read_snapshot do
|
||||
processed = 0
|
||||
first_row = true
|
||||
started = false
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする