このコミットが含まれているのは:
2026-10-28 19:28:11 +09:00
コミット 8ea3d211dc
49個のファイルの変更、967行の追加、356行の削除
+7 -3
ファイルの表示
@@ -48,17 +48,19 @@ class CountsExporter
end
end
def body(progress: nil)
return @table_export.body(progress:) if @table_export
def body(progress: nil, phase: nil)
return @table_export.body(progress:, phase:) if @table_export
Enumerator.new do |output|
ApplicationRecord.transaction(isolation: :repeatable_read) do
processed = 0
first_row = true
started = false
phase&.call('aggregating')
pages do |page|
total = @mode == 'details' ? page[:count] : nil
progress&.call(processed, total)
phase&.call('writing')
unless started
meta = { resource:, mode: @mode, basis: @history ? 'history' : 'state',
at: @query_params['at'], boundary: 'inclusive',
@@ -90,6 +92,7 @@ class CountsExporter
processed += 1
progress&.call(processed, total)
end
phase&.call('aggregating')
end
progress&.call(processed, processed)
output << ']}' if format == 'json'
@@ -135,7 +138,8 @@ class CountsExporter
{ count: total,
versions: CountsVersionRepr.many(query.details, resource:,
language_code: @language,
at: Time.iso8601(@query_params['at'])) }
at: Time.iso8601(@query_params['at']),
history_flg: true) }
end
total ||= result[:group_count]
yield result