Class: Webhookdb::Replicator::IcalendarEventV1::StaleRowDeleter

Inherits:
BaseStaleRowDeleter show all
Defined in:
lib/webhookdb/replicator/icalendar_event_v1.rb

Overview

Delete CANCELLED events last updated (row_updated_at)‘ in the window between stale_at to age_cutoff. This avoids endlessly adding to the icalendar events table due to feeds that change UIDs each fetch- events with changed UIDs will become CANCELLED, and then deleted over time.

Instance Attribute Summary

Attributes inherited from BaseStaleRowDeleter

#replicator

Instance Method Summary collapse

Methods inherited from BaseStaleRowDeleter

#_run_delete, #chunk_size, #incremental_lookback_size, #initialize, #run, #run_initial, #set_autovacuum

Constructor Details

This class inherits a constructor from Webhookdb::Replicator::BaseStaleRowDeleter

Instance Method Details

#lookback_windowObject



385
# File 'lib/webhookdb/replicator/icalendar_event_v1.rb', line 385

def lookback_window = Webhookdb::Icalendar.stale_cancelled_event_lookback_days.days

#stale_atObject



384
# File 'lib/webhookdb/replicator/icalendar_event_v1.rb', line 384

def stale_at = Webhookdb::Icalendar.stale_cancelled_event_threshold_days.days

#stale_conditionObject



387
# File 'lib/webhookdb/replicator/icalendar_event_v1.rb', line 387

def stale_condition = {status: "CANCELLED"}

#updated_at_columnObject



386
# File 'lib/webhookdb/replicator/icalendar_event_v1.rb', line 386

def updated_at_column = :row_updated_at