Skip to content

Commit

Permalink
Merge pull request #759 from sul-dlss/worker_error
Browse files Browse the repository at this point in the history
Do not try to index empty lines in the json
  • Loading branch information
ndushay authored Dec 2, 2019
2 parents 22acbdb + 739b78c commit 66f1558
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: "2" # required to adjust maintainability checks
checks:
method-complexity:
config:
threshold: 6
2 changes: 2 additions & 0 deletions app/jobs/fetch_resources_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def perform(url, exhibit)
private

def create_or_update_resource(item, exhibit, index, url)
return if item.empty?

json = JSON.parse(item)
resource = DlmeJson.find_or_initialize_by(url: json['id'], exhibit: exhibit)
resource.data = { json: item }
Expand Down

0 comments on commit 66f1558

Please sign in to comment.