mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-08 16:54:31 +00:00
parent
c1467453f6
commit
07f60ffcbb
|
@ -12,12 +12,10 @@ class Scheduler::IndexingScheduler
|
|||
def perform
|
||||
indexes.each do |type|
|
||||
with_redis do |redis|
|
||||
redis.sscan_each("chewy:queue:#{type.name}", count: SCAN_BATCH_SIZE) do |ids|
|
||||
redis.pipelined do
|
||||
ids.each_slice(IMPORT_BATCH_SIZE) do |slice_ids|
|
||||
type.import!(slice_ids)
|
||||
redis.srem("chewy:queue:#{type.name}", slice_ids)
|
||||
end
|
||||
redis.sscan_each("chewy:queue:#{type.name}", count: SCAN_BATCH_SIZE).each_slice(IMPORT_BATCH_SIZE) do |ids|
|
||||
type.import!(ids)
|
||||
redis.pipelined do |pipeline|
|
||||
pipeline.srem("chewy:queue:#{type.name}", ids)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue