Skip to content

Commit

Permalink
♻️ Favor configuration over hard-coding
Browse files Browse the repository at this point in the history
Given that Hyrax provides a mechanism for specifying a queue name, we
should echo that configuration, but also provide our own configuration
as well as the same fallback.
  • Loading branch information
jeremyf committed Feb 14, 2024
1 parent 9ada93c commit 5e6809c
Show file tree
Hide file tree
Showing 8 changed files with 214 additions and 205 deletions.
2 changes: 1 addition & 1 deletion app/jobs/bulkrax/create_relationships_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CreateRelationshipsJob < ApplicationJob

include DynamicRecordLookup

queue_as :import
queue_as Bulkrax.config.ingest_queue_name

# @param parent_identifier [String] Work/Collection ID or Bulkrax::Entry source_identifiers
# @param importer_run [Bulkrax::ImporterRun] current importer run (needed to properly update counters)
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/bulkrax/delete_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Bulkrax
class DeleteJob < ApplicationJob
queue_as :import
queue_as Bulkrax.config.ingest_queue_name

def perform(entry, importer_run)
obj = entry.factory.find
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/bulkrax/download_cloud_file_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Bulkrax
class DownloadCloudFileJob < ApplicationJob
queue_as :import
queue_as Bulkrax.config.ingest_queue_name

# Retrieve cloud file and write to the imports directory
# Note: if using the file system, the mounted directory in
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/bulkrax/import_collection_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Bulkrax
class ImportCollectionJob < ApplicationJob
queue_as :import
queue_as Bulkrax.config.ingest_queue_name

# rubocop:disable Rails/SkipsModelValidations
def perform(*args)
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/bulkrax/import_file_set_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class MissingParentError < ::StandardError; end
class ImportFileSetJob < ApplicationJob
include DynamicRecordLookup

queue_as :import
queue_as Bulkrax.config.ingest_queue_name

attr_reader :importer_run_id

Expand Down
2 changes: 1 addition & 1 deletion app/jobs/bulkrax/import_work_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Bulkrax
class ImportWorkJob < ApplicationJob
queue_as :import
queue_as Bulkrax.config.ingest_queue_name

# rubocop:disable Rails/SkipsModelValidations
#
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/bulkrax/importer_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Bulkrax
class ImporterJob < ApplicationJob
queue_as :import
queue_as Bulkrax.config.ingest_queue_name

def perform(importer_id, only_updates_since_last_import = false)
importer = Importer.find(importer_id)
Expand Down
Loading

0 comments on commit 5e6809c

Please sign in to comment.