-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issues #42, #43, #52, #53 - Try bulkrax, overrides for NoMethodErrors…
… on import (bulkrax/zizia), Bulkrax import bugs, sidekiq performance issues.
- Loading branch information
Showing
4 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
app/overrides/zizia/file_set_attached_event_job_prepends.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters