diff --git a/app/jobs/regular/feature_topic_users.rb b/app/jobs/regular/feature_topic_users.rb index 6eabc024e..702fb4f6c 100644 --- a/app/jobs/regular/feature_topic_users.rb +++ b/app/jobs/regular/feature_topic_users.rb @@ -8,16 +8,10 @@ module Jobs topic = Topic.find_by(id: topic_id) - # there are 3 cases here - # 1. topic was atomically nuked, this should be skipped - # 2. topic was deleted, this should be skipped - # 3. error an incorrect topic_id was sent - - unless topic.present? - max_id = Topic.with_deleted.maximum(:id).to_i - raise Discourse::InvalidParameters.new(:topic_id) if max_id < topic_id - return - end + # Topic may be hard deleted due to spam, no point complaining + # we would have to look at the topics table id sequence to find cases + # where this was called with an invalid id, no point really + return unless topic.present? topic.feature_topic_users(args) end