Class: Restforce::DB::Cleaner

Inherits:
Task
  • Object
show all
Defined in:
lib/restforce/db/cleaner.rb

Overview

Restforce::DB::Cleaner is responsible for culling the matching database records when a Salesforce record is no longer available to synchronize for a specific mapping.

Constant Summary collapse

DELETION_READ_BUFFER =

Salesforce can take a few minutes to register record deletion. This buffer gives us a window of time (in seconds) to look back and see records which may not have been visible in previous runs.

3 * 60

Instance Method Summary collapse

Methods inherited from Task

#initialize

Constructor Details

This class inherits a constructor from Restforce::DB::Task

Instance Method Details

#run(*_) ⇒ Object

Public: Run the database culling loop for this mapping.

Returns nothing.



18
19
20
# File 'lib/restforce/db/cleaner.rb', line 18

def run(*_)
  @mapping.database_record_type.destroy_all(dropped_salesforce_ids)
end