Commit 9bcaa5bd by nnnghia98

handle exception solr add

parent 5e2c95f2
......@@ -31,10 +31,14 @@ class SolrService
jobs_solr_index.each_slice(5000) do |job|
@solr.add job
rescue Exception
job.each do |j|
@solr.add j
rescue
solr_index_error = ActiveSupport::Logger.new("log/solr_errors.log")
solr_index_error.info "This block got error!"
solr_index_error.info "This block got error! Cannot add job with id #{job.id}"
next
end
end
@solr.commit
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment