• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / bibdata / 5db7f693-1ba8-464b-88d6-caaa168a35c8

30 Dec 2024 07:22PM UTC coverage: 91.223% (-0.6%) from 91.859%
5db7f693-1ba8-464b-88d6-caaa168a35c8

Pull #2563

circleci

maxkadel
Rubocop
Pull Request #2563: I2321 Shift SCSB full index tasks into separate background jobs

134 of 163 new or added lines in 10 files covered. (82.21%)

5 existing lines in 1 file now uncovered.

3461 of 3794 relevant lines covered (91.22%)

366.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.24
/app/jobs/process_partner_updates_job.rb
1
# Extracts the xml files from the Partner zip files (previously downloaded from S3), and attaches the xml files to the associated dump
2
class ProcessPartnerUpdatesJob
1✔
3
  include Sidekiq::Job
1✔
4
  # Used for full dumps, since order does not matter for full dumps, unlike incremental dumps
5
  def perform(params)
1✔
6
    update_directory = ENV.fetch('SCSB_PARTNER_UPDATE_DIRECTORY', nil) || '/tmp/updates'
9✔
7
    file_prefix = params['file_prefix']
9✔
8
    dump_id = params['dump_id']
9✔
9
    file = params['file']
9✔
10
    xml_files = Scsb::PartnerUpdates::Update.extract_files(file:, update_directory:)
9✔
11
    attach_xml_files(xml_files:, dump_id:, file_prefix:)
1✔
12
  end
13

14
  def attach_xml_files(xml_files:, dump_id:, file_prefix:)
1✔
15
    batch = Sidekiq::Batch.new
1✔
16
    batch.description = 'Attaches each xml file extracted from the zip file downloaded from S3'
1✔
17
    batch.on(:success, Scsb::PartnerUpdates::AttachXmlFileJobCallback, xml_files:)
1✔
18
    batch.jobs do
1✔
19
      xml_files.each do |xml_file|
1✔
NEW
20
        params = { file: xml_file, dump_id:, file_prefix: }.stringify_keys
×
NEW
21
        AttachXmlFileJob.perform_async(params)
×
22
      end
23
    end
24
  end
25
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc