mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 12:03:35 +08:00
19 lines
414 B
Ruby
19 lines
414 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module Jobs
|
||
|
class GenerateTopicThumbnails < ::Jobs::Base
|
||
|
sidekiq_options queue: 'ultra_low'
|
||
|
|
||
|
def execute(args)
|
||
|
topic_id = args[:topic_id]
|
||
|
extra_sizes = args[:extra_sizes]
|
||
|
|
||
|
raise Discourse::InvalidParameters.new(:topic_id) if topic_id.blank?
|
||
|
|
||
|
topic = Topic.find(topic_id)
|
||
|
topic.generate_thumbnails!(extra_sizes: extra_sizes)
|
||
|
end
|
||
|
|
||
|
end
|
||
|
end
|