Use perform_bulk in Podcasts::EnqueueGetEpisodesWorker (#16325)
This commit is contained in:
parent
30d2ec6220
commit
914b984e9b
1 changed files with 3 additions and 3 deletions
|
|
@ -5,9 +5,9 @@ module Podcasts
|
|||
sidekiq_options queue: :medium_priority, retry: 10
|
||||
|
||||
def perform
|
||||
Podcast.published.select(:id).find_each do |podcast|
|
||||
Podcasts::GetEpisodesWorker.perform_async("podcast_id" => podcast.id, "limit" => 5)
|
||||
end
|
||||
# `perform_bulk` expects an array of argument arrays we need to wrap the hashes.
|
||||
job_params = Podcast.published.ids.map { |id| [{ "podcast_id" => id, "limit" => 5 }] }
|
||||
Podcasts::GetEpisodesWorker.perform_bulk(job_params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue