2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-02-05 13:16:51 -06:00
|
|
|
module Jobs
|
2019-10-01 23:01:53 -05:00
|
|
|
class FeatureTopicUsers < ::Jobs::Base
|
2013-02-05 13:16:51 -06:00
|
|
|
def execute(args)
|
2013-04-17 18:34:58 -05:00
|
|
|
topic_id = args[:topic_id]
|
2024-05-27 05:27:13 -05:00
|
|
|
raise Discourse::InvalidParameters.new(:topic_id) if topic_id.blank?
|
2013-04-17 18:34:58 -05:00
|
|
|
|
2014-05-06 08:41:59 -05:00
|
|
|
topic = Topic.find_by(id: topic_id)
|
2013-04-17 18:34:58 -05:00
|
|
|
|
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
|
2024-05-27 05:27:13 -05:00
|
|
|
return if topic.blank?
|
2013-02-05 13:16:51 -06:00
|
|
|
|
2013-03-12 11:33:42 -05:00
|
|
|
topic.feature_topic_users(args)
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|