From 07f60ffcbbbaf661347cd3cd7098f20d3a3730f7 Mon Sep 17 00:00:00 2001 From: Vyr Cossont Date: Fri, 31 Mar 2023 23:28:35 -0700 Subject: [PATCH] Fix Redis client and type errors introduced in #24285 (#24342) --- app/workers/scheduler/indexing_scheduler.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/workers/scheduler/indexing_scheduler.rb b/app/workers/scheduler/indexing_scheduler.rb index b055322599..2f05b5f81b 100644 --- a/app/workers/scheduler/indexing_scheduler.rb +++ b/app/workers/scheduler/indexing_scheduler.rb @@ -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