diff options
author | Vyr Cossont <VyrCossont@users.noreply.github.com> | 2023-03-31 23:28:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-01 08:28:35 +0200 |
commit | d5ad8b6422432b5a0e8f5268d662e6121186f532 (patch) | |
tree | b75ecc041fac709072e03f11799423b34772a4c9 /app | |
parent | 280fa3b2c01b9d6c5cfb2ed608087038b6c1a0ae (diff) |
Fix Redis client and type errors introduced in #24285 (#24342)
Diffstat (limited to 'app')
-rw-r--r-- | app/workers/scheduler/indexing_scheduler.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/workers/scheduler/indexing_scheduler.rb b/app/workers/scheduler/indexing_scheduler.rb index 1bbe9cd5d..d622f5586 100644 --- a/app/workers/scheduler/indexing_scheduler.rb +++ b/app/workers/scheduler/indexing_scheduler.rb @@ -14,12 +14,10 @@ class Scheduler::IndexingScheduler 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 |