Merge branch 'main' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2022-05-24 13:59:21 +02:00
130 changed files with 2804 additions and 674 deletions

View File

@ -0,0 +1,26 @@
# frozen_string_literal: true
class Scheduler::IndexingScheduler
include Sidekiq::Worker
include Redisable
sidekiq_options retry: 0
def perform
indexes.each do |type|
with_redis do |redis|
ids = redis.smembers("chewy:queue:#{type.name}")
type.import!(ids)
redis.pipelined do |pipeline|
ids.each { |id| pipeline.srem("chewy:queue:#{type.name}", id) }
end
end
end
end
def indexes
[AccountsIndex, TagsIndex, StatusesIndex]
end
end