このコミットが含まれているのは:
2026-10-26 21:24:32 +09:00
コミット 2563b3fef3
21個のファイルの変更、703行の追加、54行の削除
+8 -2
ファイルの表示
@@ -47,14 +47,17 @@ class CountsExporter
end
end
def body
return @table_export.body if @table_export
def body(progress: nil)
return @table_export.body(progress:) if @table_export
Enumerator.new do |output|
ApplicationRecord.transaction(isolation: :repeatable_read) do
processed = 0
first_row = true
started = false
pages do |page|
total = @mode == 'details' ? page[:count] : nil
progress&.call(processed, total)
unless started
meta = { resource:, mode: @mode, basis: @history ? 'history' : 'state',
at: @query_params['at'], boundary: 'inclusive',
@@ -83,8 +86,11 @@ class CountsExporter
output << CSV.generate_line(values, row_sep: "\r\n")
end
first_row = false
processed += 1
progress&.call(processed, total)
end
end
progress&.call(processed, processed)
output << ']}' if format == 'json'
end
end