Skip to content

Commit

Permalink
Export members in batches during sync process
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanb777 committed Feb 19, 2025
1 parent e9fa7c4 commit ac4bff7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/identity_tijuana.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ def self.fetch_user_updates_impl(sync_id)
)
).pluck('member_id')

updated_members = Member.includes(:phone_numbers, :addresses, :member_subscriptions)
.where(id: updated_member_ids)
updated_member_ids.each_slice(Settings.tijuana.pull_batch_amount) do |batch_ids|
updated_members = Member.includes(:phone_numbers, :addresses, :member_subscriptions)
.where(id: batch_ids)

updated_members.each do |member|
MemberSync.export_member(member, sync_id)
updated_members.each do |member|
MemberSync.export_member(member, sync_id)
end
end

unless updated_users.empty?
Expand Down

0 comments on commit ac4bff7

Please sign in to comment.