Skip to content

Commit

Permalink
[Scheduler::IndexingScheduler] Ignore import! exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ushitora-anqou committed Sep 24, 2023
1 parent 578c0e0 commit 3b4ae57
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/workers/scheduler/indexing_scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def perform
with_redis do |redis|
redis.sscan_each("chewy:queue:#{type.name}", count: SCAN_BATCH_SIZE).each_slice(IMPORT_BATCH_SIZE) do |ids|
type.import!(ids)

rescue => e
Rails.logger.error("Error while running #{type.name}#import!: #{e}")
ensure
redis.srem("chewy:queue:#{type.name}", ids)
end
end
Expand Down

0 comments on commit 3b4ae57

Please # to comment.