Skip to content

Commit

Permalink
Issues #42, #43, #52, #53 - Try bulkrax, overrides for NoMethodErrors…
Browse files Browse the repository at this point in the history
… on import (bulkrax/zizia), Bulkrax import bugs, sidekiq performance issues.
  • Loading branch information
svogtunh committed Jun 29, 2020
1 parent 791edc3 commit b1755c4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ gem 'jquery-rails'
gem 'devise'
gem 'sidekiq'


gem 'devise-guests', '~> 0.6'
group :development, :test do
gem 'fcrepo_wrapper'
Expand Down
3 changes: 3 additions & 0 deletions app/overrides/bulkrax/oai_dc_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ def create_works
# CODE BLOCK 1
#

#=begin
seen[record.identifier] = true
new_entry = entry_class.where(importerexporter: self.importerexporter, identifier: record.identifier).first_or_create!
ImportWorkJob.send(perform_method, new_entry.id, importerexporter.current_importer_run.id)
increment_counters(index)
#=end

# Use either code block 1 or code block 2, not both.
# Eventually, direction for this should come from the importer form. We should customize the importer form for this.
Expand All @@ -46,6 +48,7 @@ def create_works
end
=end


end
end
end
Expand Down
29 changes: 29 additions & 0 deletions app/overrides/zizia/file_set_attached_event_job_prepends.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require_dependency Zizia::Engine.config.root.join('config', 'initializers', 'file_set_attached_event_job_prepends.rb').to_s

module FileSetAttachedEventJobPrepends
def action
if repo_object.kind_of?(FileSet)

# Override - returns if no files in file_set. Prevents NoMethodError('size') on 'pre_ingest_file = ...' below.
if repo_object.files.first.nil?
return
end

pre_ingest_work_id = Zizia::PreIngestWork.find_by(deduplication_key: curation_concern.deduplication_key)
pre_ingest_file = Zizia::PreIngestFile.find_by(size: repo_object.files.first.size,
filename: repo_object.files.first.original_name,
pre_ingest_work_id: pre_ingest_work_id)

# Override - returns if no files in file_set. Prevents NoMethodError('status=') on 'pre_ingest_file.status = ...' below.
if curation_concern.deduplication_key.nil?
return
end

pre_ingest_file.status = 'attached'
pre_ingest_file.save
end
end
end



3 changes: 2 additions & 1 deletion config/sidekiq.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#:concurrency: 3
:concurrency: 1
#:concurrency: 3
:concurrency: <%= ENV['SIDEKIQ_MAX_THREADS'] || '3' %>
:queues:
- default
- import
Expand Down

0 comments on commit b1755c4

Please sign in to comment.