Commit 9bcaa5bd by nnnghia98

handle exception solr add

parent 5e2c95f2
...@@ -31,9 +31,13 @@ class SolrService ...@@ -31,9 +31,13 @@ class SolrService
jobs_solr_index.each_slice(5000) do |job| jobs_solr_index.each_slice(5000) do |job|
@solr.add job @solr.add job
rescue Exception rescue Exception
solr_index_error = ActiveSupport::Logger.new("log/solr_errors.log") job.each do |j|
solr_index_error.info "This block got error!" @solr.add j
next rescue
solr_index_error = ActiveSupport::Logger.new("log/solr_errors.log")
solr_index_error.info "This block got error! Cannot add job with id #{job.id}"
next
end
end end
@solr.commit @solr.commit
......
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