Improved error handling if object is already deleted.
This commit is contained in:
parent
13ff0054b6
commit
7e3738aaa4
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue