automation and view updates
This commit is contained in:
@@ -21,13 +21,16 @@ module AutomationService
|
||||
member_update_futures = vw_mb_members.map do |vw_mb_member|
|
||||
Concurrent::Future.execute do
|
||||
ActiveRecord::Base.connection_pool.with_connection do
|
||||
UpdateMemberJob.perform_now(@pb_entity_key, employer.id, card_setup.has_divisions, card_setup.has_dental, vw_mb_member)
|
||||
UpdateMemberJob.perform_now(vw_mb_member.pb_entity_key, employer.id, card_setup.has_divisions, card_setup.has_dental, vw_mb_member)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
member_updates = member_update_futures.map(&:value).compact
|
||||
employer.members = member_updates
|
||||
if member_updates.empty? && employer.id_card_setup.active
|
||||
employer.active = false
|
||||
end
|
||||
employer.save
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user