Skip to content

Commit fd4d319

Browse files
authored
Merge pull request #1544 from pod4lib/1541-handling-compacted
Do not try to extract records from compacted uploads
2 parents 84a3c5e + a6b888c commit fd4d319

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

app/jobs/generate_full_dump_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def perform(stream, effective_date: Time.zone.now, publish: true)
3939

4040
GenerateDeltaDumpJob.perform_now(stream, publish: publish) if stream.current_full_dump
4141

42-
uploads.where.not(status: 'processed').find_each do |upload|
42+
uploads.where.not(status: %w[processed compacted]).find_each do |upload|
4343
ExtractMarcRecordMetadataJob.perform_now(upload)
4444
end
4545

spec/jobs/generate_full_dump_job_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@
7777
end
7878
# rubocop:enable RSpec/ExampleLength
7979

80+
it 'does not attempt to extract records from compacted uploads' do
81+
described_class.perform_now(organization.default_stream)
82+
CompactUploadsJob.perform_now(organization.default_stream, age: 0.seconds, min_uploads: 0)
83+
84+
expect do
85+
described_class.perform_now(organization.default_stream)
86+
end.not_to change(MarcRecord, :count)
87+
end
88+
8089
it 'has a content type of application/gzip for compressed marcxml' do
8190
described_class.perform_now(organization.default_stream)
8291

0 commit comments

Comments
 (0)