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
1 changed files with 1 additions and 1 deletions

View File

@ -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