Skip to content

Commit

Permalink
tweak logging for indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Oct 16, 2018
1 parent ae37b90 commit 36bb8a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,12 @@ def self.index_by_day(options={})
count += dois.length
dois.each { |doi| doi.update_column(:indexed, Time.zone.now) }
end

logger.info "[Elasticsearch] #{errors} errors indexing #{count} DOIs created on #{from_date.strftime("%F")}."

if errors > 1
logger.info "[Elasticsearch] #{errors} errors indexing #{count} DOIs created on #{from_date.strftime("%F")}."
elsif count > 1
logger.info "[Elasticsearch] Indexed #{count} DOIs created on #{from_date.strftime("%F")}."
end
end

def uid
Expand Down

0 comments on commit 36bb8a7

Please sign in to comment.