Improved error handling if object is already deleted.

This commit is contained in:
Martin Edenhofer 2016-06-14 13:40:04 +02:00
parent 13ff0054b6
commit 7e3738aaa4

View file

@ -6,6 +6,11 @@ class ApplicationModel::BackgroundJobSearchIndex
end end
def perform def perform
Object.const_get(@object).find(@o_id).search_index_update_backend record = Object.const_get(@object).lookup(id: @o_id)
if !record
Rails.logger.notice "Can't index #{@object}.find(#{@o_id}), no such record found"
return
end
record.search_index_update_backend
end end
end end