Updated

app/use_cases/accounts/apps/chatwoots / sync_export_contacts.rb

A
15 lines of codes
2 methods
6.2 complexity/method
7 churn
12.36 complexity
0 duplications
class Accounts::Apps::Chatwoots::SyncExportContacts
  1. Accounts::Apps::Chatwoots::SyncExportContacts has no descriptive comment
def self.call(account) export_contacts(account) end def self.export_contacts(account) account.contacts.where("additional_attributes -> 'chatwoot_id' IS NULL").find_in_batches(batch_size: 30) do |group| group.each do |contact|
  1. Accounts::Apps::Chatwoots::SyncExportContacts#self.export_contacts contains iterators nested 2 deep
Accounts::Apps::Chatwoots::ExportContact.call(account.apps_chatwoots.first, contact) end sleep(15) end { ok: 'Contacts exported successfully' } end end