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:
Krzysztof Kotlarek 2020-11-30 11:41:32 +11:00 committed by Alan Guo Xiang Tan
parent 99240476cb
commit b7490e894f

View File

@ -3,7 +3,7 @@
class Jobs::IndexCategoryForSearch < Jobs::Base
def execute(args)
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)
end