2013-02-05 14:16:51 -05:00
|
|
|
module Jobs
|
|
|
|
|
|
|
|
class FeatureTopicUsers < Jobs::Base
|
|
|
|
|
|
|
|
def execute(args)
|
2013-04-17 19:34:58 -04:00
|
|
|
topic_id = args[:topic_id]
|
|
|
|
raise Discourse::InvalidParameters.new(:topic_id) unless topic_id.present?
|
|
|
|
|
2014-05-06 09:41:59 -04:00
|
|
|
topic = Topic.find_by(id: topic_id)
|
2013-04-17 19:34:58 -04:00
|
|
|
|
2015-08-13 23:29:39 -04: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 unless topic.present?
|
2013-02-05 14:16:51 -05:00
|
|
|
|
2013-03-12 12:33:42 -04:00
|
|
|
topic.feature_topic_users(args)
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|