discourse/app/jobs/regular/feature_topic_users.rb

20 lines
554 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2013-02-05 13:16:51 -06:00
module Jobs
class FeatureTopicUsers < ::Jobs::Base
2013-02-05 13:16:51 -06:00
def execute(args)
topic_id = args[:topic_id]
raise Discourse::InvalidParameters.new(:topic_id) if topic_id.blank?
topic = Topic.find_by(id: topic_id)
2015-08-13 22:29:39 -05:00
# 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 if topic.blank?
2013-02-05 13:16:51 -06:00
topic.feature_topic_users(args)
2013-02-05 13:16:51 -06:00
end
end
end