Skip to content

Commit

Permalink
fix syntax. #388
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 2, 2020
1 parent e49a611 commit 8111a32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def self.update_crossref(options = {})
if response.results.total > 0
while response.results.results.length > 0 do
response = Event.query(nil, source_id: "crossref", page: { size: size, cursor: cursor })
break unless response.results.results.length > 0
break unless response.results.results.length.positive?

Rails.logger.info "[Update] Updating #{response.results.results.length} crossref events starting with _id #{response.results.to_a.first[:_id]}."
cursor = response.results.to_a.last[:sort]
Expand All @@ -382,7 +382,7 @@ def self.update_target_doi(options = {})
if response.results.total > 0
while response.results.results.length > 0 do
response = Event.query(nil, target_doi: nil, page: { size: size, cursor: cursor })
break unless response.results.results.positive?
break unless response.results.results.length.positive?

Rails.logger.info "[Update] Updating #{response.results.results.length} events with no target_doi starting with _id #{response.results.to_a.first[:_id]}."
cursor = response.results.to_a.last[:sort]
Expand Down

0 comments on commit 8111a32

Please sign in to comment.