Commit 942dda17910b0513d32efbd7862493fe0e126677
1 parent
e8a97db5
Exists in
master
and in
1 other branch
Updated readme [skip ci]
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
README.md
... | ... | @@ -1626,7 +1626,7 @@ class ReindexConversionsJob < ApplicationJob |
1626 | 1626 | Searchjoy::Conversion.where(convertable_type: class_name).where(created_at: since..) |
1627 | 1627 | .order(:convertable_id).distinct.pluck(:convertable_id) |
1628 | 1628 | |
1629 | - # split into groups | |
1629 | + # split into batches | |
1630 | 1630 | recently_converted_ids.in_groups_of(1000, false) do |ids| |
1631 | 1631 | # fetch conversions |
1632 | 1632 | conversions = |
... | ... | @@ -1634,13 +1634,13 @@ class ReindexConversionsJob < ApplicationJob |
1634 | 1634 | .joins(:search).where.not(searchjoy_searches: {user_id: nil}) |
1635 | 1635 | .group(:convertable_id, :query).distinct.count(:user_id) |
1636 | 1636 | |
1637 | - # group conversions by record | |
1637 | + # group by record | |
1638 | 1638 | conversions_by_record = {} |
1639 | 1639 | conversions.each do |(id, query), count| |
1640 | 1640 | (conversions_by_record[id] ||= {})[query] = count |
1641 | 1641 | end |
1642 | 1642 | |
1643 | - # update column | |
1643 | + # update conversions column | |
1644 | 1644 | model = Searchkick.load_model(class_name) |
1645 | 1645 | model.transaction do |
1646 | 1646 | conversions_by_record.each do |id, conversions| | ... | ... |