FIX: don't error-index category job when missing category
When the category is missing we should not throw an error but just finish the job.
This commit is contained in:
parent
99240476cb
commit
b7490e894f
|
@ -3,7 +3,7 @@
|
||||||
class Jobs::IndexCategoryForSearch < Jobs::Base
|
class Jobs::IndexCategoryForSearch < Jobs::Base
|
||||||
def execute(args)
|
def execute(args)
|
||||||
category = Category.find_by(id: args[:category_id])
|
category = Category.find_by(id: args[:category_id])
|
||||||
raise Discourse::InvalidParameters.new(:category_id) if category.blank?
|
return if category.blank?
|
||||||
|
|
||||||
SearchIndexer.index(category, force: args[:force] || false)
|
SearchIndexer.index(category, force: args[:force] || false)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue