Module: Etl::Integrations::Core::Fullrefresher

Included in:
Destination::GoogleSheets::Client, Destination::Sftp::Client
Defined in:
lib/etl/integrations/core/fullrefresher.rb

Instance Method Summary collapse

Instance Method Details

#write(sync_config, records, action = "insert") ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/etl/integrations/core/fullrefresher.rb', line 6

def write(sync_config, records, action = "insert")
  if sync_config && sync_config.sync_mode == "full_refresh" && !@full_refreshed
    response = clear_all_records(sync_config)
    return response unless response &&
                           response.control.status == Etl::Integrations::Protocol::ConnectionStatusType["succeeded"]

    @full_refreshed = true
  end

  super(sync_config, records, action)
end